From f0c8db3d0fc3c4b604c4a4f94e6e2a6e2232127a Mon Sep 17 00:00:00 2001 From: GinjaNinja32 Date: Tue, 18 Aug 2015 02:16:50 +0100 Subject: [PATCH] Adds settable rank to IRC messages, changes it so non-admins can see who on IRC is messaging them, and adds the name of the original sender to reply PMs --- code/modules/admin/verbs/adminpm.dm | 21 +++++++++++---------- code/modules/client/client procs.dm | 2 +- code/world.dm | 8 ++++++-- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 26cae206e9..ca2fd11f9c 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -118,30 +118,31 @@ if(X.key != key && X.key != C.key && (X.holder.rights & R_ADMIN|R_MOD|R_MENTOR)) X << "" + create_text_tag("pm_other", "PM:", X) + " [key_name(src, X, 0)] to [key_name(C, X, 0)]: [msg]" -/client/proc/cmd_admin_irc_pm() +/client/proc/cmd_admin_irc_pm(sender) if(prefs.muted & MUTE_ADMINHELP) src << "Error: Private-Message: You are unable to use PM-s (muted)." return - var/msg = input(src,"Message:", "Private message to admins on IRC / 400 character limit") as text|null + var/msg = input(src,"Message:", "Reply private message to [sender] on IRC / 400 character limit") as text|null if(!msg) return sanitize(msg) - if(length(msg) > 400) // TODO: if message length is over 400, divide it up into seperate messages, the message length restriction is based on IRC limitations. Probably easier to do this on the bots ends. - src << "\red Your message was not sent because it was more then 400 characters find your message below for ease of copy/pasting" - src << "\blue [msg]" - return + // Handled on Bot32's end, unsure about other bots +// if(length(msg) > 400) // TODO: if message length is over 400, divide it up into seperate messages, the message length restriction is based on IRC limitations. Probably easier to do this on the bots ends. +// src << "Your message was not sent because it was more then 400 characters find your message below for ease of copy/pasting" +// src << "\blue [msg]" +// return - send2adminirc("PlayerPM from [key_name(src)]: [html_decode(msg)]") + send2adminirc("PlayerPM to [sender] from [key_name(src)]: [html_decode(msg)]") - src << "" + create_text_tag("pm_out_alt", "", src) + " to Admin IRC: [msg]" + src << "" + create_text_tag("pm_out_alt", "", src) + " to IRC-[sender]: [msg]" - log_admin("PM: [key_name(src)]->IRC: [msg]") + log_admin("PM: [key_name(src)]->IRC-[sender]: [msg]") for(var/client/X in admins) if(X == src) continue if(X.holder.rights & R_ADMIN|R_MOD) - X << "" + create_text_tag("pm_other", "PM:", X) + " [key_name(src, X, 0)] to Admin IRC: [msg]" + X << "" + create_text_tag("pm_other", "PM:", X) + " [key_name(src, X, 0)] to IRC-[sender]: [msg]" diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index f9c67496a8..ecbd78b14d 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -52,7 +52,7 @@ if(mute_irc) usr << "" return - cmd_admin_irc_pm() + cmd_admin_irc_pm(href_list["irc_msg"]) return diff --git a/code/world.dm b/code/world.dm index 2b8b0f07f3..34b9107699 100644 --- a/code/world.dm +++ b/code/world.dm @@ -183,8 +183,12 @@ var/world_topic_spam_protect_time = world.timeofday if(!C) return "No client with that name on server" - var/message = "IRC-Admin PM from [C.holder ? "IRC-" + input["sender"] : "Administrator"]: [input["msg"]]" - var/amessage = "IRC-Admin PM from IRC-[input["sender"]] to [key_name(C)] : [input["msg"]]" + var/rank = input["rank"] + if(!rank) + rank = "Admin" + + var/message = "IRC-[rank] PM from IRC-[input["sender"]]: [input["msg"]]" + var/amessage = "IRC-[rank] PM from IRC-[input["sender"]] to [key_name(C)] : [input["msg"]]" C.received_irc_pm = world.time C.irc_admin = input["sender"]