mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 05:30:05 +01:00
Add expiration time for admin messages (#39502)
* add expiration time for messages * typo * fix * src to usr * allows removing expiry from existing messages * cancel button
This commit is contained in:
@@ -663,7 +663,7 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
|
||||
var/sql_system_ckey = sanitizeSQL(system_ckey)
|
||||
var/sql_ckey = sanitizeSQL(ckey)
|
||||
//check to see if we noted them in the last day.
|
||||
var/datum/DBQuery/query_get_notes = SSdbcore.NewQuery("SELECT id FROM [format_table_name("messages")] WHERE type = 'note' AND targetckey = '[sql_ckey]' AND adminckey = '[sql_system_ckey]' AND timestamp + INTERVAL 1 DAY < NOW() AND deleted = 0")
|
||||
var/datum/DBQuery/query_get_notes = SSdbcore.NewQuery("SELECT id FROM [format_table_name("messages")] WHERE type = 'note' AND targetckey = '[sql_ckey]' AND adminckey = '[sql_system_ckey]' AND timestamp + INTERVAL 1 DAY < NOW() AND deleted = 0 AND expire_timestamp > NOW()")
|
||||
if(!query_get_notes.Execute())
|
||||
qdel(query_get_notes)
|
||||
return
|
||||
@@ -672,7 +672,7 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
|
||||
return
|
||||
qdel(query_get_notes)
|
||||
//regardless of above, make sure their last note is not from us, as no point in repeating the same note over and over.
|
||||
query_get_notes = SSdbcore.NewQuery("SELECT adminckey FROM [format_table_name("messages")] WHERE targetckey = '[sql_ckey]' AND deleted = 0 ORDER BY timestamp DESC LIMIT 1")
|
||||
query_get_notes = SSdbcore.NewQuery("SELECT adminckey FROM [format_table_name("messages")] WHERE targetckey = '[sql_ckey]' AND deleted = 0 AND expire_timestamp > NOW() ORDER BY timestamp DESC LIMIT 1")
|
||||
if(!query_get_notes.Execute())
|
||||
qdel(query_get_notes)
|
||||
return
|
||||
@@ -681,7 +681,7 @@ GLOBAL_LIST_EMPTY(external_rsc_urls)
|
||||
qdel(query_get_notes)
|
||||
return
|
||||
qdel(query_get_notes)
|
||||
create_message("note", key, system_ckey, message, null, null, 0, 0)
|
||||
create_message("note", key, system_ckey, message, null, null, 0, 0, null, 0)
|
||||
|
||||
|
||||
/client/proc/check_ip_intel()
|
||||
|
||||
Reference in New Issue
Block a user