Improves Fax Logging (#26506)

* Adds logging for faxes

* Reverts a testing change
This commit is contained in:
Burzah
2024-08-29 00:02:23 +00:00
committed by GitHub
parent ccf70d51ca
commit b36bb57525
+25
View File
@@ -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)