* Fix #854 Added ViewChannel enum and property to channel permissions * replaced usages of ChannelPermission#ReadMessages with ViewChannel * rename parameter of ChannelPermissions constructor * made OverwritePermissions#ReadMessages obsolete, use ViewChannel instead * Fix #854 Added ViewChannel enum and property to channel permissions replaced usages of ChannelPermission#ReadMessages with ViewChannel rename parameter of ChannelPermissions constructor made OverwritePermissions#ReadMessages obsolete, use ViewChannel instead * renamed readMessages parameter in ChannelPermissions constructor and Modify * fixed channel permission tests to use ChannelPermission enum instead of GuildPermission enum * replaced usages of readmessages in channel permission tests * resolve build warnings for permission tests
This commit is contained in:
committed by
Christopher F
parent
804d9188e7
commit
edfbd055bb
@@ -25,7 +25,7 @@ namespace Discord.WebSocket
|
||||
public override IReadOnlyCollection<SocketGuildUser> Users
|
||||
=> Guild.Users.Where(x => Permissions.GetValue(
|
||||
Permissions.ResolveChannel(Guild, x, this, Permissions.ResolveGuild(Guild, x)),
|
||||
ChannelPermission.ReadMessages)).ToImmutableArray();
|
||||
ChannelPermission.ViewChannel)).ToImmutableArray();
|
||||
|
||||
internal SocketTextChannel(DiscordSocketClient discord, ulong id, SocketGuild guild)
|
||||
: base(discord, id, guild)
|
||||
@@ -107,7 +107,7 @@ namespace Discord.WebSocket
|
||||
{
|
||||
var guildPerms = Permissions.ResolveGuild(Guild, user);
|
||||
var channelPerms = Permissions.ResolveChannel(Guild, user, this, guildPerms);
|
||||
if (Permissions.GetValue(channelPerms, ChannelPermission.ReadMessages))
|
||||
if (Permissions.GetValue(channelPerms, ChannelPermission.ViewChannel))
|
||||
return user;
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user