From 2a1c0668b6c2fa95efcbcda95603f4671ae7681b Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 7 Aug 2022 17:43:42 +0200 Subject: [PATCH] [MIRROR] Catches an edge case in ahelp replies [MDB IGNORE] (#15454) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Catches an edge case in ahelp replies (#69053) It turns out if you hit reply to an ahelp before it was closed, and then sent back the input() after close, you'd end up with a runtime leaking your reply, and no feedback. This catches that case, and instead forwards it to a new ahelp, so the text isn't lost, and the closed ticket is respected Approved by sitting headcatmin Timberpose 🆑 fix: Attempting to send back a reply to an ahelp after it is closed now sends the reply to a new ticket, rather then just dropping it and leaving you for dead with a runtime admin: see above /🆑 * Catches an edge case in ahelp replies Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> --- code/modules/admin/verbs/adminpm.dm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 0abf2ca6f8e..f553fa3dc49 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -450,6 +450,20 @@ // Ok by this point the recipient has to be an admin, and this is either an admin on admin event, or a player replying to an admin + // You're replying to a ticket that is closed. Bad move. You must have started replying before the close, and then got input()'d + // Lets be nice and pass this off to a new ticket, as we recomend above + if(!ticket) + to_chat(src, + type = MESSAGE_TYPE_ADMINPM, + html = span_danger("Error: Admin-PM-Send: Attempted to send a reply to a closed ticket."), + confidential = TRUE) + to_chat(src, + type = MESSAGE_TYPE_ADMINPM, + html = span_notice("Relaying message to a new admin help."), + confidential = TRUE) + GLOB.admin_help_ui_handler.perform_adminhelp(src, raw_message, FALSE) + return FALSE + // Let's play some music for the admin, only if they want it tho if(sound_prefs & SOUND_ADMINHELP) SEND_SOUND(recipient, sound('sound/effects/adminhelp.ogg'))