Skip to content

Commit

Permalink
Support Audit Log change key for timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
wasdennnoch committed Apr 2, 2024
1 parent 3581eab commit 71d93ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public enum AuditLogChangeType implements Nameable {
DEAF("deaf"),
MUTE("mute"),
NICK("nick"),
COMMUNICATION_DISABLED_UNTIL("communication_disabled_until"),

// integration
ENABLE_EMOTICONS("enable_emoticons"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.awt.Color;
import java.net.MalformedURLException;
import java.net.URL;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
Expand Down Expand Up @@ -222,6 +223,13 @@ public AuditLogEntryImpl(AuditLog auditLog, JsonNode data) {
change = new AuditLogChangeImpl<>(AuditLogChangeType.UNKNOWN, oldValue, newValue);
}
break;
case COMMUNICATION_DISABLED_UNTIL:
change = new AuditLogChangeImpl<>(
type,
oldValue != null ? OffsetDateTime.parse(oldValue.asText()).toInstant() : null,
newValue != null ? OffsetDateTime.parse(newValue.asText()).toInstant() : null
);
break;
case TYPE:
// TODO Find a good way to both handle integers (channel type) and strings
change = new AuditLogChangeImpl<>(type, oldValue, newValue);
Expand Down

0 comments on commit 71d93ee

Please sign in to comment.