Note fading and persistent messages

Player Notes can now fade out over time so admins don't accidentally ban players for 4 year old notes
Deleted messages now remain in the database and are instead just hidden from view.

Two things relating to messages I've been meaning to do for ever.
This commit is contained in:
MrStonedOne
2017-08-30 22:10:56 -07:00
parent 2580b81465
commit ca33ca2e05
10 changed files with 78 additions and 33 deletions
+2 -2
View File
@@ -565,13 +565,13 @@ GLOBAL_LIST(external_rsc_urls)
var/const/adminckey = "CID-Error"
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 = '[adminckey]' AND timestamp + INTERVAL 1 DAY < NOW()")
var/datum/DBQuery/query_get_notes = SSdbcore.NewQuery("SELECT id FROM [format_table_name("messages")] WHERE type = 'note' AND targetckey = '[sql_ckey]' AND adminckey = '[adminckey]' AND timestamp + INTERVAL 1 DAY < NOW() AND deleted = 0")
if(!query_get_notes.Execute())
return
if(query_get_notes.NextRow())
return
//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]' 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 ORDER BY timestamp DESC LIMIT 1")
if(!query_get_notes.Execute())
return
if(query_get_notes.NextRow())
+1 -1
View File
@@ -234,7 +234,7 @@ GLOBAL_VAR_INIT(normal_ooc_colour, OOC_COLOR)
to_chat(usr, "<span class='notice'>Sorry, that function is not enabled on this server.</span>")
return
browse_messages(null, usr.ckey, null, 1)
browse_messages(null, usr.ckey, null, TRUE)
/client/proc/ignore_key(client)
var/client/C = client