From b36bb57525efef09bf9e9cffbd233913028079c6 Mon Sep 17 00:00:00 2001 From: Burzah <116982774+Burzah@users.noreply.github.com> Date: Thu, 29 Aug 2024 00:02:23 +0000 Subject: [PATCH] Improves Fax Logging (#26506) * Adds logging for faxes * Reverts a testing change --- code/modules/paperwork/faxmachine.dm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm index 71da6a1ac3f..d653f591775 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -339,6 +339,30 @@ GLOBAL_LIST_EMPTY(fax_blacklist) use_power(active_power_consumption) +/obj/machinery/photocopier/faxmachine/proc/log_fax(mob/sender, destination) + // Logging for sending photos + if(istype(copyitem, /obj/item/photo)) + log_admin("[key_name(sender)] has sent a photo by fax to [destination]") + return + + // Logging for single paper message + if(istype(copyitem, /obj/item/paper)) + var/obj/item/paper/fax_message = copyitem + log_admin("[key_name(sender)] has sent a message by fax to [destination] reading [fax_message.info]") + return + + // Logging for paper bundle messages + if(istype(copyitem, /obj/item/paper_bundle)) + var/obj/item/paper_bundle/paper_bundle = copyitem + // Incremented by one for each paper in the bundle + var/page_count = 1 + + // Loop through the contents of the paper bundle and grab the message from each page + for(var/obj/item/paper/page in paper_bundle.contents) + log_admin("[key_name(sender)] has sent a bundled message by fax to [destination] - Page [page_count]: [page.info]") + page_count ++ + return + /obj/machinery/photocopier/faxmachine/proc/send_admin_fax(mob/sender, destination) use_power(active_power_consumption) @@ -365,6 +389,7 @@ GLOBAL_LIST_EMPTY(fax_blacklist) if(F.department == destination) F.receivefax(copyitem) visible_message("[src] beeps, \"Message transmitted successfully.\"") + log_fax(sender, destination) /obj/machinery/photocopier/faxmachine/proc/cooldown_seconds() if(sendcooldown < world.time)