From b073649ad8b3d723b94e84642d5a77c981a112ca Mon Sep 17 00:00:00 2001 From: khyperia Date: Mon, 31 Jul 2017 14:43:39 -0700 Subject: [PATCH] Rip out channel permission blocking Something is horribly wrong. See #33 --- src/connection.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/connection.rs b/src/connection.rs index 8f91ee0..921d50b 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -91,13 +91,16 @@ impl<'dis> ChannelData<'dis> { if channel.kind == ChannelType::Voice { return true; } + // TODO: Something is horribly broken here. (issue #33) + // Likely discord-rs's permissions_for is broken. + // Ripping it out for now :( // ugh. Why is this not a public API in discord-rs? - let read_messages = Permissions::from_bits(1 << 10).unwrap(); - let permissions = server.permissions_for(channel.id(), state.user().id()); - let can_read = permissions.contains(read_messages); - if !can_read { - return true; - } + //let read_messages = Permissions::from_bits(1 << 10).unwrap(); + //let permissions = server.permissions_for(channel.id(), state.user().id()); + //let can_read = permissions.contains(read_messages); + //if !can_read { + // return true; + //} } if let Some(muted) = get_option(&format!("mute.{}", channel.id())) { return muted.parse::().ok().map_or(false, |x| x != 0);