Simplify MSG case handling in ChatService by directly comparing receiver UUID.
This commit is contained in:
parent
a9d788b319
commit
ed942d5ec5
|
|
@ -118,20 +118,7 @@ public class ChatService {
|
|||
}
|
||||
yield chatMessage.getChannel().equals(String.valueOf(partyId));
|
||||
}
|
||||
case MSG -> {
|
||||
if (eventUser.uuid().equals(chatMessage.getUuid())) {
|
||||
yield true;
|
||||
}
|
||||
if (chatMessage.getReceiver() != null) {
|
||||
try {
|
||||
UUID receiverUuid = UUID.fromString(chatMessage.getReceiver());
|
||||
yield eventUser.uuid().equals(receiverUuid);
|
||||
} catch (IllegalArgumentException e) {
|
||||
yield false;
|
||||
}
|
||||
}
|
||||
yield false;
|
||||
}
|
||||
case MSG -> eventUser.uuid().toString().equals(chatMessage.getReceiver());
|
||||
case GAC -> eventUser.hasPermission(PermissionClaimDto.MOD);
|
||||
case CUSTOM -> false;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user