<commit_before>
/var/list/tickets_list = list()
/var/ticket_count = 0;

/datum/ticket_log
	var/text
	var/admin_only = 0

/datum/ticket_log/New(ntext, nadmin = 0)
	text = ntext
	admin_only = nadmin



/datum/admin_ticket
	var/ticket_id
	var/client/owner
	var/owner_ckey
	var/title
	var/list/log = list()
	var/resolved = 0
	var/list/monitors = list()
	var/client/handling_admin = null
	var/client/pm_started_user = null
	var/pm_started_flag = 0
	var/error = 0
	//var/log_file

/datum/admin_ticket/New(nowner, ntitle, ntarget)
	if(compare_ckey(nowner, ntarget))
		usr << "<span class='ticket-status'>You cannot make a ticket for yourself</span>"
		return

	owner = get_client(nowner)
	owner_ckey = get_ckey(owner)

	if(owner.holder && ntarget)
		handling_admin = get_client(owner)
		owner = get_client(ntarget)
		owner_ckey = get_ckey(ntarget)

	for(var/datum/admin_ticket/T in tickets_list)
		if(!T.resolved && (compare_ckey(owner_ckey, T.owner_ckey)/* || compare_ckey(handling_admin, T.handling_admin)*/))
			error = 1
			usr << "<span class='ticket-status'>Ticket not created. This user already has a ticket. You can view it here: [T.get_view_link(usr)]</span>"
			// Code removed. This would usually enable adding comments to tickets.
			//   we instead want a new ticket to be created.<commit_msg>Set error flag: No new ticket to be created on failure.<commit_after>
/var/list/tickets_list = list()
/var/ticket_count = 0;

/datum/ticket_log
	var/text
	var/admin_only = 0

/datum/ticket_log/New(ntext, nadmin = 0)
	text = ntext
	admin_only = nadmin



/datum/admin_ticket
	var/ticket_id
	var/client/owner
	var/owner_ckey
	var/title
	var/list/log = list()
	var/resolved = 0
	var/list/monitors = list()
	var/client/handling_admin = null
	var/client/pm_started_user = null
	var/pm_started_flag = 0
	var/error = 0
	//var/log_file

/datum/admin_ticket/New(nowner, ntitle, ntarget)
	if(compare_ckey(nowner, ntarget))
		usr << "<span class='ticket-status'>You cannot make a ticket for yourself</span>"
		error = 1
		return

	owner = get_client(nowner)
	owner_ckey = get_ckey(owner)

	if(owner.holder && ntarget)
		handling_admin = get_client(owner)
		owner = get_client(ntarget)
		owner_ckey = get_ckey(ntarget)

	for(var/datum/admin_ticket/T in tickets_list)
		if(!T.resolved && (compare_ckey(owner_ckey, T.owner_ckey)/* || compare_ckey(handling_admin, T.handling_admin)*/))
			error = 1
			usr << "<span class='ticket-status'>Ticket not created. This user already has a ticket. You can view it here: [T.get_view_link(usr)]</span>"
			// Code removed. This would usually enable adding comments to tickets.
			//   we instead want a new ticket to be created.
{'fraction_non_alphanumeric': 0.12179487179487179, 'fraction_numerical': 0.005656108597285068, 'mean_word_length': 4.151456310679611, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5096335', 'n_tokens_mistral': 1058, 'n_tokens_neox': 973, 'n_words': 231}