Skip to content

Conversation

@davidhu99
Copy link

@davidhu99 davidhu99 commented Apr 15, 2021

Type

  • Bugfix
  • Enhancement
  • New feature

Description of the changes

Previously, when the author wanted to mute an already muted user, if muted user already inside muted list (if statement on line 1666), "That user is already muted in this channel." would be sent to the text channel and the user's current mute duration would not get updated.

Currently, when author mutes an already muted user, there will be an update to the mute duration. One case we accounted for is if the author changes the mute duration and happens to hit it after the mute task has been created. In this case, there may be an extra unmute task in the self.unmute_tasks cache, which will do nothing. We accounted for this by checking if an unmute task is in the unmute_tasks cache, and cancelling it if there is.

Closes #4834

@davidhu99 davidhu99 requested a review from TrustyJAID as a code owner April 15, 2021 20:02
@github-actions github-actions bot added the Category: Cogs - Mutes This is related to the Mutes cog. label Apr 15, 2021
@Flame442 Flame442 added the Type: Enhancement Something meant to enhance existing Red features. label Apr 15, 2021
@bobloy
Copy link
Contributor

bobloy commented Apr 15, 2021

Is it correct to allow the mute command to shorten the duration of the mute too?

@davidhu99
Copy link
Author

Is it correct to allow the mute command to shorten the duration of the mute too?

Good point, in my opinion it should not. However, in the original issue the author said to "update" which would be both shorten and lengthen. Let me know whether to only shorten!

@TrustyJAID
Copy link
Member

@bobloy Yes the mute command should allow shortening the duration of a mute as well as extending it, it is the moderators perogative to choose when to mute until and maybe they want to lessen the time to unmute.

Something that wasn't really discussed but should be addressed for consistency is the mute function should also check if there is an existing server unmute task when a user is server muted and cancel the task the same way you did for channel mutes.

@davidhu99
Copy link
Author

@bobloy Yes the mute command should allow shortening the duration of a mute as well as extending it, it is the moderators perogative to choose when to mute until and maybe they want to lessen the time to unmute.

Something that wasn't really discussed but should be addressed for consistency is the mute function should also check if there is an existing server unmute task when a user is server muted and cancel the task the same way you did for channel mutes.

I believe I did that with my if condition on line 1668. Let me know if that's not the correct way to do it

@TrustyJAID
Copy link
Member

You handled it for channel mutes but role-based server mutes still suffer from the same issue.

@davidhu99
Copy link
Author

You handled it for channel mutes but role-based server mutes still suffer from the same issue.

I see, please check out my last commit for the solution to that :)

@davidhu99 davidhu99 requested a review from TrustyJAID April 21, 2021 18:45
@davidhu99 davidhu99 requested a review from Kowlin as a code owner April 22, 2021 21:13
@github-actions github-actions bot added the Category: Cogs - Permissions This is related to the Permissions cog. label Apr 22, 2021
@Jackenmen Jackenmen added this to the 3.4.11 milestone May 15, 2021
@Jackenmen Jackenmen changed the title Allow mute commands to update duration of the mute #4834 Allow mute commands to update duration of the mute Jun 25, 2021
@Jackenmen Jackenmen modified the milestones: 3.4.13, 3.4.x Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Category: Cogs - Mutes This is related to the Mutes cog. Category: Cogs - Permissions This is related to the Permissions cog. Type: Enhancement Something meant to enhance existing Red features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow mute commands to update duration of the mute

5 participants