mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 06:28:54 +00:00
Redo mutehandler logic
This commit is contained in:
1 parent
e0f03795e3
commit
0505308371
2 files changed
+17
-2
No files matched your search
@@ -32,8 +32,19 @@ public class MuteHandler {
|
||||
|
||||
carbonChat.eventHandler().subscribe(CarbonChatEvent.class, 100, false, event -> {
|
||||
for (final var muteEntry : event.sender().muteEntries()) {
|
||||
if (muteEntry.channel() != null && event.chatChannel().key().equals(muteEntry.channel())) {
|
||||
return;
|
||||
// Entry expired
|
||||
if (!muteEntry.valid()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Muted in all channels
|
||||
if (muteEntry.channel() == null) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Muted in the channel the message was sent in
|
||||
if (event.chatChannel().key().equals(muteEntry.channel())) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user