Simplify MSG case handling in ChatService by directly comparing receiver UUID.
This commit is contained in:
@@ -118,20 +118,7 @@ public class ChatService {
|
|||||||
}
|
}
|
||||||
yield chatMessage.getChannel().equals(String.valueOf(partyId));
|
yield chatMessage.getChannel().equals(String.valueOf(partyId));
|
||||||
}
|
}
|
||||||
case MSG -> {
|
case MSG -> eventUser.uuid().toString().equals(chatMessage.getReceiver());
|
||||||
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 GAC -> eventUser.hasPermission(PermissionClaimDto.MOD);
|
case GAC -> eventUser.hasPermission(PermissionClaimDto.MOD);
|
||||||
case CUSTOM -> false;
|
case CUSTOM -> false;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user