Browse Source

Fixed permission cache errors when adding a channel

tags/docs-0.9
RogueException 9 years ago
parent
commit
75d2d456a5
2 changed files with 7 additions and 1 deletions
  1. +5
    -0
      src/Discord.Net/Models/Channel.cs
  2. +2
    -1
      src/Discord.Net/Models/Server.cs

+ 5
- 0
src/Discord.Net/Models/Channel.cs 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)


+ 2
- 1
src/Discord.Net/Models/Server.cs 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;
}


Loading…
Cancel
Save