Browse Source

Update DM channel on entity updates.

tags/1.0
AntiTcb 8 years ago
parent
commit
aeef5d0893
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      src/Discord.Net.WebSocket/Entities/Users/SocketGlobalUser.cs

+ 2
- 0
src/Discord.Net.WebSocket/Entities/Users/SocketGlobalUser.cs View File

@@ -1,4 +1,5 @@
using System.Diagnostics;
using System.Linq;
using Model = Discord.API.User;
using PresenceModel = Discord.API.Presence;

@@ -51,6 +52,7 @@ namespace Discord.WebSocket
internal void Update(ClientState state, PresenceModel model)
{
Presence = SocketPresence.Create(model);
DMChannel = state.DMChannels.FirstOrDefault(x => x.Recipient.Id == Id);
}
internal new SocketGlobalUser Clone() => MemberwiseClone() as SocketGlobalUser;


Loading…
Cancel
Save