mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
[MIRROR] Chat history prototype (#10278)
Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
36231619db
commit
09bb0e61b3
@@ -29,6 +29,9 @@
|
||||
if(target == world)
|
||||
target = GLOB.clients
|
||||
|
||||
if(islist(target) && !LAZYLEN(target))
|
||||
return
|
||||
|
||||
// Build a message
|
||||
var/message = list()
|
||||
if(type) message["type"] = type
|
||||
@@ -39,6 +42,18 @@
|
||||
// send it immediately
|
||||
SSchat.send_immediate(target, message)
|
||||
|
||||
if (CONFIG_GET(flag/chatlog_database_backend))
|
||||
if (islist(target))
|
||||
for(var/tgt in target)
|
||||
var/our_ckey = CKEY_FROM_VAR(tgt)
|
||||
if(isnull(our_ckey))
|
||||
continue
|
||||
vchatlog_write(our_ckey, html, GLOB.round_id, type)
|
||||
else
|
||||
var/our_ckey = CKEY_FROM_VAR(target)
|
||||
if(!isnull(our_ckey))
|
||||
vchatlog_write(our_ckey, html, GLOB.round_id, type)
|
||||
|
||||
/**
|
||||
* Sends the message to the recipient (target).
|
||||
*
|
||||
@@ -76,6 +91,9 @@
|
||||
if(target == world)
|
||||
target = GLOB.clients
|
||||
|
||||
if(islist(target) && !LAZYLEN(target))
|
||||
return
|
||||
|
||||
// Build a message
|
||||
var/message = list()
|
||||
if(type) message["type"] = type
|
||||
@@ -83,3 +101,15 @@
|
||||
if(html) message["html"] = html
|
||||
if(avoid_highlighting) message["avoidHighlighting"] = avoid_highlighting
|
||||
SSchat.queue(target, message)
|
||||
|
||||
if (CONFIG_GET(flag/chatlog_database_backend))
|
||||
if (islist(target))
|
||||
for(var/tgt in target)
|
||||
var/our_ckey = CKEY_FROM_VAR(tgt)
|
||||
if(isnull(our_ckey))
|
||||
continue
|
||||
vchatlog_write(our_ckey, html, GLOB.round_id, type)
|
||||
else
|
||||
var/our_ckey = CKEY_FROM_VAR(target)
|
||||
if(!isnull(our_ckey))
|
||||
vchatlog_write(our_ckey, html, GLOB.round_id, type)
|
||||
|
||||
Reference in New Issue
Block a user