[MIRROR] Fixes an adminPM dead end eating replies (#1857)

* Fixes an adminPM dead end eating replies (#55127)

If you tried to reply to an admin that had deadminned while you were typing you would get an error and your message was eaten. Now sends to MessageNoRecipient if theres an open ticket, or prints a warning and the message in chat if there isn't.

* Fixes an adminPM dead end eating replies

Co-authored-by: skoglol <33292112+kriskog@users.noreply.github.com>
This commit is contained in:
SkyratBot
2020-11-27 00:18:22 +01:00
committed by GitHub
parent 2cc3eba10c
commit e976ff3a3d
+11 -5
View File
@@ -294,11 +294,17 @@
INVOKE_ASYNC(src, .proc/popup_admin_pm, recipient, msg)
else //neither are admins
to_chat(src,
type = MESSAGE_TYPE_ADMINPM,
html = "<span class='danger'>Error: Admin-PM: Non-admin to non-admin PM communication is forbidden.</span>",
confidential = TRUE)
return
if(!current_ticket)
to_chat(src,
type = MESSAGE_TYPE_ADMINPM,
html = "<span class='danger'>Error: Admin-PM: Non-admin to non-admin PM communication is forbidden.</span>",
confidential = TRUE)
to_chat(src,
type = MESSAGE_TYPE_ADMINPM,
html = "<span class='danger'><b>Message not sent:</b></span><br>[msg]",
confidential = TRUE)
return
current_ticket.MessageNoRecipient(msg)
if(external)
log_admin_private("PM: [key_name(src)]->External: [rawmsg]")