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

[V3] Unmute has odd behaviour on admins #2076

Closed
coltoutram opened this issue Sep 1, 2018 · 9 comments
Closed

[V3] Unmute has odd behaviour on admins #2076

coltoutram opened this issue Sep 1, 2018 · 9 comments
Labels
Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.
Milestone

Comments

@coltoutram
Copy link

Command bugs

Command name

Unmute

What cog is this command from?

Mod

What were you expecting to happen?

Unmute someone from the server.

What actually happened?

It sent the "user has been unmuted from the server" but did not remove the permissions from the channels.

How can we reproduce this issue?

Mute someone using [p]mute server user and then [p]unmute server user and it will not remove the permissions from the channels.

@Tobotimus Tobotimus added Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing. V3 Status: Needs Info Needs more info, probably from the author. labels Sep 2, 2018
@coltoutram
Copy link
Author

What kind of info is needed?

@Ray-MRQ
Copy link

Ray-MRQ commented Sep 3, 2018

traceback error... if there is one

edit: "but did not remove the permissions from the channels." that doesn't mean they weren't unmuted it just means the user profile on the channel wasn't removed if you check it the write perm was re-enabled (if i understood that correctly)

@Zephyrkul
Copy link
Contributor

I've been playing around with this a little. This is in a test server with no special channel overwrites beyond an admin role that has access to a private category, text channel, and voice channel. This isn't full QA by any means but it's what I found while messing around with it.

Mute:
For every channel the bot and member have access to...
Categories and VCs are denied the Speak permission.
Text channels are denied Send Messages and Add Reactions.
(As a small note this causes categories and their text channels to no longer be in sync.)
No traceback in console.

Unmute:
I got a couple different results depending on the member's permissions.
If the member has the admin override, nothing happens. Overwrites set via Mute are as they were.
If the member has no admin override, text channel overwrites are deleted, while category and VC overwrites for that member are set to all None (including for categories / VCs that were not touched by mute beforehand).
The bot having a higher role than the member or not has no effect on the above behavior.
No traceback in console in either case.

@coltoutram
Copy link
Author

coltoutram commented Sep 5, 2018

The bot has the highest role and none of the users I am trying to mute have a role above the BOT, I'm confused why mute works but unmute does not, any info?

@Zephyrkul
Copy link
Contributor

Literally that big ol' comment directly above yours was a huge infodump when I tested this issue out. Give it a read if you want info.

@coltoutram
Copy link
Author

Yes I read that, from what I understand it does not work the way it is intended to?

@Zephyrkul
Copy link
Contributor

As it stands, based on my testing, [p]unmute does function, though it could use improvements. In my testing it only ever failed to unmute members who had the Administrator override in their permissions, which allows them to bypass channel permissions. So muting/unmuting doesn't affect them either way. Since currently the bot only unmutes in channels the member can't send messages to, it doesn't change permissions for Administrator members.

In other words, since the muted member was an Administrator, they were never muted in the first place, so there's nothing to unmute, so the bot didn't touch channel overwrites.

@coltoutram
Copy link
Author

I see now, I'm confused why it mutes people with administrator but then does not unmute them though

@Tobotimus Tobotimus added Status: Accepted We want this and removed Status: Needs Info Needs more info, probably from the author. labels Sep 18, 2018
@Tobotimus Tobotimus changed the title [V3] Unmute does not work. [V3] Unmute has odd behaviour on admins Sep 18, 2018
@Tobotimus Tobotimus added Status: In Progress There's a PR open to deal with this, or an org member is working on this internally and removed Status: Accepted We want this labels Oct 7, 2018
@Tobotimus Tobotimus added this to the RC 2 milestone Oct 7, 2018
Tobotimus pushed a commit that referenced this issue Oct 12, 2018
- Helper methods mute_user and unmute_user now take GuildChannel instead of solely TextChannel.
- The bot will not attempt to mute a member with the Administrator permission, as that permission bypasses channel overwrites anyway. The bot will still unmute members with the Administrator permission (see #2076).
- Audit reasons are now specified for mass mutes / unmutes.
- A few typos and missing keyword specifiers were corrected.
- Streamlined some logic and used some already-existing functions.
@Tobotimus
Copy link
Member

Resolved by #2230.

@Tobotimus Tobotimus removed the Status: In Progress There's a PR open to deal with this, or an org member is working on this internally label Oct 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants