Fixed permission cache errors when adding a channel

This commit is contained in:
RogueException
2015-12-26 02:38:14 -04:00
parent f61b9febfb
commit 75d2d456a5
2 changed files with 7 additions and 1 deletions

View File

@@ -107,6 +107,11 @@ namespace Discord
: this(client, id)
{
Server = server;
if (server != null)
{
foreach (var user in server.Users)
AddUser(user);
}
}
internal Channel(DiscordClient client, ulong id, User recipient)
: this(client, id)

View File

@@ -204,7 +204,8 @@ namespace Discord
#region Channels
internal Channel AddChannel(ulong id)
{
var channel = _channels.GetOrAdd(id, x => new Channel(Client, x, this));
var channel = new Channel(Client, id, this);
channel = _channels.GetOrAdd(id, x => channel);
Client.AddChannel(channel);
return channel;
}