diff options
| author | acdenisSK <[email protected]> | 2017-09-09 10:53:44 +0200 |
|---|---|---|
| committer | acdenisSK <[email protected]> | 2017-09-09 10:56:29 +0200 |
| commit | 4be6b9d5008ff8bb3d1fdddff5647a6bb307513c (patch) | |
| tree | 516b811875ae4cb2b98c308aabb69bc6e7a94fd2 /src/model/utils.rs | |
| parent | Change order to avoid subtraction overflow error (#160) (diff) | |
| download | serenity-4be6b9d5008ff8bb3d1fdddff5647a6bb307513c.tar.xz serenity-4be6b9d5008ff8bb3d1fdddff5647a6bb307513c.zip | |
Implement categories
Diffstat (limited to 'src/model/utils.rs')
| -rw-r--r-- | src/model/utils.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/model/utils.rs b/src/model/utils.rs index 9fed660..123f683 100644 --- a/src/model/utils.rs +++ b/src/model/utils.rs @@ -76,6 +76,7 @@ pub fn deserialize_private_channels<'de, D: Deserializer<'de>>( Channel::Group(ref group) => group.read().unwrap().channel_id, Channel::Private(ref channel) => channel.read().unwrap().id, Channel::Guild(_) => unreachable!("Guild private channel decode"), + Channel::Category(_) => unreachable!("Channel category private channel decode"), }; private_channels.insert(id, private_channel); @@ -157,8 +158,9 @@ pub fn user_has_perms(channel_id: ChannelId, mut permissions: Permissions) -> Re let guild_id = match channel { Channel::Guild(channel) => channel.read().unwrap().guild_id, Channel::Group(_) | - Channel::Private(_) => { - // Both users in DMs, and all users in groups, will have the same + Channel::Private(_) | + Channel::Category(_) => { + // Both users in DMs, and all users in groups and maybe all channels in categories will have the same // permissions. // // The only exception to this is when the current user is blocked by |