From a39d2c5cc623aa03e3637039c8976e4fc5361992 Mon Sep 17 00:00:00 2001 From: SinTwo Date: Thu, 19 May 2016 14:17:12 -0400 Subject: [PATCH] Fixes Note Keeper and empty message sending null --- .../items/devices/communicator/communicator.dm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/code/game/objects/items/devices/communicator/communicator.dm b/code/game/objects/items/devices/communicator/communicator.dm index 0d15f795bd..bc80bc9db3 100644 --- a/code/game/objects/items/devices/communicator/communicator.dm +++ b/code/game/objects/items/devices/communicator/communicator.dm @@ -375,8 +375,9 @@ var/global/list/obj/item/device/communicator/all_communicators = list() return var/their_address = href_list["message"] var/text = sanitizeSafe(input(usr,"Enter your message.","Text Message")) - exonet.send_message(their_address, "text", text) - im_list += list(list("address" = exonet.address, "to_address" = their_address, "im" = text)) + if(text) + exonet.send_message(their_address, "text", text) + im_list += list(list("address" = exonet.address, "to_address" = their_address, "im" = text)) if(href_list["disconnect"]) var/name_to_disconnect = href_list["disconnect"] @@ -403,12 +404,15 @@ var/global/list/obj/item/device/communicator/all_communicators = list() selected_tab = href_list["switch_tab"] if(href_list["edit"]) - var/n = input(usr, "Please enter message", name, notehtml) as message + var/n = input(usr, "Please enter message", name, notehtml) n = sanitizeSafe(n, extra = 0) - if (selected_tab == 5) + if(n) note = html_decode(n) notehtml = note note = replacetext(note, "\n", "
") + else + note = "" + notehtml = note nanomanager.update_uis(src) add_fingerprint(usr)