Messages sent by yourself no longer highlight (#52991)

This commit is contained in:
Jared-Fogle
2020-08-18 05:54:29 +03:00
committed by GitHub
parent b477dfb96a
commit fa11c9c7be
6 changed files with 12 additions and 6 deletions
@@ -48,5 +48,7 @@
create_chat_message(speaker, message_language, raw_message, spans)
// Recompose the message, because it's scrambled by default
message = compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mods)
to_chat(src, "[link] [message]")
to_chat(src,
html = "[link] [message]",
avoid_highlighting = speaker == src)
+1 -1
View File
@@ -249,7 +249,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list(
// Recompose message for AI hrefs, language incomprehension.
message = compose_message(speaker, message_language, raw_message, radio_freq, spans, message_mods)
show_message(message, MSG_AUDIBLE, deaf_message, deaf_type)
show_message(message, MSG_AUDIBLE, deaf_message, deaf_type, avoid_highlighting = speaker == src)
return message
/mob/living/send_speech(message, message_range = 6, obj/source = src, bubble_type = bubble_icon, list/spans, datum/language/message_language=null, list/message_mods = list())
+2 -2
View File
@@ -133,7 +133,7 @@
/**
* Show a message to this mob (visual or audible)
*/
/mob/proc/show_message(msg, type, alt_msg, alt_type)//Message, type of message (1 or 2), alternative message, alt message type (1 or 2)
/mob/proc/show_message(msg, type, alt_msg, alt_type, avoid_highlighting = FALSE)//Message, type of message (1 or 2), alternative message, alt message type (1 or 2)
if(!client)
return
@@ -160,7 +160,7 @@
if(type & MSG_AUDIBLE) //audio
to_chat(src, "<I>... You can almost hear something ...</I>")
return
to_chat(src, msg)
to_chat(src, msg, avoid_highlighting = avoid_highlighting)
/**
* Generate a visible message from this atom
+4
View File
@@ -10,6 +10,7 @@
/proc/to_chat_immediate(target, html,
type = null,
text = null,
avoid_highlighting = FALSE,
// FIXME: These flags are now pointless and have no effect
handle_whitespace = TRUE,
trailing_newline = TRUE,
@@ -23,6 +24,7 @@
if(type) message["type"] = type
if(text) message["text"] = text
if(html) message["html"] = html
if(avoid_highlighting) message["avoidHighlighting"] = avoid_highlighting
var/message_blob = TGUI_CREATE_MESSAGE("chat/message", message)
var/message_html = message_to_html(message)
if(islist(target))
@@ -52,6 +54,7 @@
/proc/to_chat(target, html,
type = null,
text = null,
avoid_highlighting = FALSE,
// FIXME: These flags are now pointless and have no effect
handle_whitespace = TRUE,
trailing_newline = TRUE,
@@ -68,4 +71,5 @@
if(type) message["type"] = type
if(text) message["text"] = text
if(html) message["html"] = html
if(avoid_highlighting) message["avoidHighlighting"] = avoid_highlighting
SSchat.queue(target, message)
+1 -1
View File
@@ -302,7 +302,7 @@ class ChatRenderer {
logger.error('Error: message is missing text payload', message);
}
// Highlight text
if (this.highlightRegex) {
if (!message.avoidHighlighting && this.highlightRegex) {
const highlighted = highlightNode(node,
this.highlightRegex,
text => (
File diff suppressed because one or more lines are too long