Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unmarked admin tickets are automatically marked when responding to one #6167

Merged
merged 2 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions code/modules/admin/verbs/adminhelp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -543,27 +543,28 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
log_ahelp(id, "Defer", "Deferred to mentors by [usr.key]", null, usr.ckey)
Close(silent = TRUE)

/datum/admin_help/proc/mark_ticket()
/datum/admin_help/proc/mark_ticket(mob/marking_admin)
var/mob/user = marking_admin || usr
if(marked_admin)
if(marked_admin == usr.ckey)
if(marked_admin == user.ckey)
unmark_ticket()
return
to_chat(usr, SPAN_WARNING("This ticket has already been marked by [marked_admin]."))
var/unmark_option = tgui_alert(usr, "This message has been marked by [marked_admin]. Do you want to override?", "Marked Ticket", list("Overwrite Mark", "Unmark", "Cancel"))
to_chat(user, SPAN_WARNING("This ticket has already been marked by [marked_admin]."))
var/unmark_option = tgui_alert(user, "This message has been marked by [marked_admin]. Do you want to override?", "Marked Ticket", list("Overwrite Mark", "Unmark", "Cancel"))
if(unmark_option == "Unmark")
unmark_ticket()
return
if(unmark_option != "Overwrite Mark")
return

var/key_name = key_name_admin(usr)
var/key_name = key_name_admin(user)
AddInteraction("Marked by [key_name].", player_message = "Ticket marked!")
to_chat(initiator, SPAN_ADMINHELP("An admin is preparing to respond to your ticket."))
var/msg = "Ticket [TicketHref("#[id]")] marked by [key_name]."
message_admins(msg)
log_admin_private(msg)
log_ahelp(id, "Marked", "Marked by [usr.key]", sender = usr.ckey)
marked_admin = usr.ckey
log_ahelp(id, "Marked", "Marked by [user.key]", sender = user.ckey)
marked_admin = user.ckey

/datum/admin_help/proc/unmark_ticket()
var/key_name = key_name_admin(usr)
Expand Down
3 changes: 3 additions & 0 deletions code/modules/admin/verbs/adminpm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@

var/message_prompt = "Message:"

if(AH && !AH.marked_admin)
AH.mark_ticket()

if((AH?.opening_responders && length(AH.ticket_interactions) == 1 ) || ((AH?.marked_admin && AH?.marked_admin != usr.ckey) && length(AH.ticket_interactions) == 2))
SEND_SOUND(src, sound('sound/machines/buzz-sigh.ogg', volume=30))
message_prompt += "\n\n**This ticket is already being responded to by: [length(AH.opening_responders) ? english_list(AH.opening_responders) : AH.marked_admin]**"
Expand Down
Loading