[MIRROR] Non-admin observers can now use emoji that start with d or p at the beginning of a message without admin command warnings. (#4162)

* Observers can now use emojis at the start of messages without the risk of triggering admin commands. (#57433)

Added a client.holder check to the line about radio extensions for admin chat and deadchat commands. It means common observers can finally spam dchat with plushie emoji. Admin observers still have to deadmin before using emojis safely, until someone takes the time to refactor saycode mods so these admin commands only acept the comma prefix (luckily, observer/get_message_mods() doesn't trim the message).

* Non-admin observers can now use emoji that start with d or p at the beginning of a message without admin command warnings.

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-03-15 01:21:19 +01:00
committed by GitHub
parent 0b2b6a1b2a
commit 5437e34b65
@@ -15,7 +15,7 @@
return
var/list/message_mods = list()
message = get_message_mods(message, message_mods)
if(client && (message_mods[RADIO_EXTENSION] == MODE_ADMIN || message_mods[RADIO_EXTENSION] == MODE_DEADMIN))
if(client?.holder && (message_mods[RADIO_EXTENSION] == MODE_ADMIN || message_mods[RADIO_EXTENSION] == MODE_DEADMIN))
message = trim_left(copytext_char(message, length(message_mods[RADIO_KEY]) + 2))
if(message_mods[RADIO_EXTENSION] == MODE_ADMIN)
client.cmd_admin_say(message)