Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As of 1bb57f0d640431598da043edb8, channels requiring special access are hidden #33

Open
FredrIQ opened this issue Jul 27, 2017 · 4 comments

Comments

@FredrIQ
Copy link

FredrIQ commented Jul 27, 2017

...even if you actually should have access to them.

@FredrIQ
Copy link
Author

FredrIQ commented Jul 27, 2017

Actually it's weirder than that. Some channels that I should have access to are hidden, while some nonpublic ones but that I have access to aren't.

@khyperia
Copy link
Owner

Please paste commit hashes in the main message, and not the title, and if you do so, please decribe what the commit is so that all information is gathed in one place. It makes reading titles of issues much easier, and allows git to link to the commit diff.

This would be a discord-rs bug if so. The only logic in weechat-discord is these lines

let permissions = server.permissions_for(channel.id(), state.user().id());
and there's nothing there to explain that behavior (but potentially lots to explain it in discord-rs, e.g. the implementation of permissons_for).

(I have double-checked the 1 << 10 value, both discord-rs has the value in a private API, as well as the official discord docs list 0x00000400 as READ_MESSAGES)

Please make sure that this is indeed the reason why the channels are not showing up, and not because you have them muted (as was also introduced in that commit). If so, I'm going to need more information on what exactly these channels you do/don't have access to, as I can't fix a vague "it doesn't work".

@FredrIQ
Copy link
Author

FredrIQ commented Jul 31, 2017

OK, I got some time to look a bit into this. Basically this may or may not be a bug in the discord library you depend on.

I added 'MAIN_BUFFER.print(&format!("perms for {}: {}", channel.id(), permissions.bits()))' for blocking and it lists the permissions for a known good channel as 67108864, or 0x4000000 which seems to be "change nickname". This also happens to a fair share of channels I don't have access to. I have currently no way to use an official Discord client or webchat, so I cannot try to figure out what's going on that way. As a temporary measure I special cased the channel ID in the function and it allowed me to read/write things correctly, see nicknames, etc, so I clearly have access to it. I will see if I can investigate this further in a week-ish when I'm back home and can use the official webchat.

khyperia added a commit that referenced this issue Jul 31, 2017
Something is horribly wrong. See #33
@khyperia
Copy link
Owner

That makes me really really sad :( - I ripped it out for now (revering to old behavior), until we figure something out. A workaround right now would be to mute the channels you don't have access to.

Thank you so much for the research.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants