fix emoji exploit: sending emoji to self causes game to crash (#1889)

## Description:

When emoji is sent to oneself, it triggers: Cannot send emoji to
oneself: ${this}, because the canSendEmoji wasn't checking if it was
itself.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

evan
This commit is contained in:
evanpelle
2025-08-21 15:07:31 -07:00
committed by GitHub
parent 3fab7ef814
commit 3fc34c931e
+3
View File
@@ -551,6 +551,9 @@ export class PlayerImpl implements Player {
}
canSendEmoji(recipient: Player | typeof AllPlayers): boolean {
if (recipient === this) {
return false;
}
const recipientID =
recipient === AllPlayers ? AllPlayers : recipient.smallID();
const prevMsgs = this.outgoingEmojis_.filter(