Skip to content

Commit

Permalink
Rip out channel permission blocking
Browse files Browse the repository at this point in the history
Something is horribly wrong. See #33
  • Loading branch information
khyperia committed Jul 31, 2017
1 parent 67d74d1 commit b073649
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<i32>().ok().map_or(false, |x| x != 0);
Expand Down

0 comments on commit b073649

Please sign in to comment.