Skip to content

Conversation

@Zabuzard
Copy link
Member

@Zabuzard Zabuzard commented Feb 9, 2022

Overview

Fixes and closes #371.

Revocations of temporary moderation actions (such as temp bans) have to be logged with the opposing action type (unban) in the /audit command:

audit example

Details

The relevant section in the code is TemporaryModerationRoutine.java#130:

actionsStore.addAction(
  guild.getIdLong(),
  jda.getSelfUser().getIdLong(),
  target.getIdLong(),
  actionType, // <--- should be UNBAN not BAN
  null,
  reason);

The opposing type information already exists and can be grabbed from the RevocableModerationAction computed in the next line, such as:

var action = getRevocableActionByType(actionType);
var opposingType = action.getRevokeType();
...

So we just moved the line above and use the getRevokeType() instead now.

* when revoking a temp action (BAN), the revocation has to be logged with the opposing type (UNBAN) for /audit
@Zabuzard Zabuzard added bug Something isn't working priority: normal labels Feb 9, 2022
@Zabuzard Zabuzard added this to the Improvement phase 1 milestone Feb 9, 2022
@Zabuzard Zabuzard requested review from a team as code owners February 9, 2022 09:59
@Zabuzard Zabuzard self-assigned this Feb 9, 2022
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 9, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@Zabuzard Zabuzard merged commit 5e43ab4 into develop Feb 9, 2022
@Zabuzard Zabuzard deleted the bugfix/temp_revoke_use_opposing_type branch February 9, 2022 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Temp revocation should use opposing type

4 participants