From e976ff3a3d0a72874b33fcf6564ad7ec136fdec9 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 27 Nov 2020 00:18:22 +0100 Subject: [PATCH] [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> --- code/modules/admin/verbs/adminpm.dm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 0109e49e7b2..1bad7eb45b8 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -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 = "Error: Admin-PM: Non-admin to non-admin PM communication is forbidden.", - confidential = TRUE) - return + if(!current_ticket) + to_chat(src, + type = MESSAGE_TYPE_ADMINPM, + html = "Error: Admin-PM: Non-admin to non-admin PM communication is forbidden.", + confidential = TRUE) + to_chat(src, + type = MESSAGE_TYPE_ADMINPM, + html = "Message not sent:
[msg]", + confidential = TRUE) + return + current_ticket.MessageNoRecipient(msg) if(external) log_admin_private("PM: [key_name(src)]->External: [rawmsg]")