Skip to content

Commit

Permalink
ahelp touchups (#5859)
Browse files Browse the repository at this point in the history
tiny admin fixes

:cl:
admin: opening a new ticket via pming now automatically marks the ticket
/:cl:
  • Loading branch information
harryob authored Mar 2, 2024
1 parent 5ebac75 commit e17b068
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
10 changes: 5 additions & 5 deletions code/modules/admin/verbs/adminhelp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
if(state != AHELP_ACTIVE)
return

if(marked_admin != usr.key)
if(marked_admin && marked_admin != usr.ckey)
to_chat(usr, SPAN_WARNING("This ticket is currently marked by [marked_admin]. Please override their mark to interact with this ticket!"))
return

Expand All @@ -489,7 +489,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
if(state != AHELP_ACTIVE)
return

if(marked_admin != usr.key)
if(marked_admin && marked_admin != usr.ckey)
to_chat(usr, SPAN_WARNING("This ticket is currently marked by [marked_admin]. Please override their mark to interact with this ticket!"))
return

Expand All @@ -511,7 +511,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
if(state != AHELP_ACTIVE || !initial_message)
return

if(marked_admin != usr.key)
if(marked_admin && marked_admin != usr.ckey)
to_chat(usr, SPAN_WARNING("This ticket is currently marked by [marked_admin]. Please override their mark to interact with this ticket!"))
return

Expand Down Expand Up @@ -539,7 +539,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)

/datum/admin_help/proc/mark_ticket()
if(marked_admin)
if(marked_admin == usr.key)
if(marked_admin == usr.ckey)
unmark_ticket()
return
to_chat(usr, SPAN_WARNING("This ticket has already been marked by [marked_admin]."))
Expand All @@ -557,7 +557,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
message_admins(msg)
log_admin_private(msg)
log_ahelp(id, "Marked", "Marked by [usr.key]", sender = usr.ckey)
marked_admin = usr.key
marked_admin = usr.ckey

/datum/admin_help/proc/unmark_ticket()
var/key_name = key_name_admin(usr)
Expand Down
3 changes: 2 additions & 1 deletion code/modules/admin/verbs/adminpm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@
if(CLIENT_IS_STAFF(src)) //sender is an admin but recipient is not. Do BIG RED TEXT
var/already_logged = FALSE
if(!recipient.current_ticket)
new /datum/admin_help(msg, recipient, TRUE)
var/datum/admin_help/new_ticket = new(msg, recipient, TRUE)
new_ticket.marked_admin = ckey
already_logged = TRUE
log_ahelp(recipient.current_ticket.id, "Ticket Opened", msg, recipient.ckey, src.ckey)

Expand Down
3 changes: 0 additions & 3 deletions code/modules/mob/mob_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

var/atom/movable/screen/hands = null //robot

var/adminhelp_marked = 0 // Prevents marking an Adminhelp more than once. Making this a client define will cause runtimes and break some Adminhelps
var/adminhelp_marked_admin = "" // Ckey of last marking admin

/// a ckey that persists client logout / ghosting, replaced when a client inhabits the mob
var/persistent_ckey

Expand Down

0 comments on commit e17b068

Please sign in to comment.