@@ -207,7 +207,7 @@ | |||||
<Compile Include="Rest\Entities\Users\User.cs" /> | <Compile Include="Rest\Entities\Users\User.cs" /> | ||||
<Compile Include="TokenType.cs" /> | <Compile Include="TokenType.cs" /> | ||||
<Compile Include="WebSocket\MessageCache.cs" /> | <Compile Include="WebSocket\MessageCache.cs" /> | ||||
<Compile Include="WebSocket\ChannelPermissionsCache.cs" /> | |||||
<Compile Include="WebSocket\PermissionsCache.cs" /> | |||||
<Compile Include="WebSocket\DiscordClient.cs" /> | <Compile Include="WebSocket\DiscordClient.cs" /> | ||||
<Compile Include="WebSocket\Entities\Channels\DMChannel.cs" /> | <Compile Include="WebSocket\Entities\Channels\DMChannel.cs" /> | ||||
<Compile Include="WebSocket\Entities\Channels\GuildChannel.cs" /> | <Compile Include="WebSocket\Entities\Channels\GuildChannel.cs" /> | ||||
@@ -11,7 +11,7 @@ namespace Discord.WebSocket | |||||
public abstract class GuildChannel : IGuildChannel | public abstract class GuildChannel : IGuildChannel | ||||
{ | { | ||||
private ConcurrentDictionary<ulong, Overwrite> _overwrites; | private ConcurrentDictionary<ulong, Overwrite> _overwrites; | ||||
internal ChannelPermissionsCache _permissions; | |||||
internal PermissionsCache _permissions; | |||||
/// <inheritdoc /> | /// <inheritdoc /> | ||||
public ulong Id { get; } | public ulong Id { get; } | ||||
@@ -1,5 +1,4 @@ | |||||
using System.Collections; | |||||
using System.Collections.Concurrent; | |||||
using System.Collections.Concurrent; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Linq; | using System.Linq; | ||||
@@ -17,14 +16,14 @@ namespace Discord.WebSocket | |||||
} | } | ||||
} | } | ||||
internal class ChannelPermissionsCache | |||||
internal class PermissionsCache | |||||
{ | { | ||||
private readonly GuildChannel _channel; | private readonly GuildChannel _channel; | ||||
private readonly ConcurrentDictionary<ulong, ChannelMember> _users; | private readonly ConcurrentDictionary<ulong, ChannelMember> _users; | ||||
public IEnumerable<ChannelMember> Members => _users.Select(x => x.Value); | public IEnumerable<ChannelMember> Members => _users.Select(x => x.Value); | ||||
public ChannelPermissionsCache(GuildChannel channel) | |||||
public PermissionsCache(GuildChannel channel) | |||||
{ | { | ||||
_channel = channel; | _channel = channel; | ||||
_users = new ConcurrentDictionary<ulong, ChannelMember>(1, (int)(_channel.Guild.UserCount * 1.05)); | _users = new ConcurrentDictionary<ulong, ChannelMember>(1, (int)(_channel.Guild.UserCount * 1.05)); |