Skip to content

Commit

Permalink
Fixes sending stuff to "Old" Chat (tgstation#79819)
Browse files Browse the repository at this point in the history
## About The Pull Request

This functionality was removed in tgstation#79479
(e1c6cfd), and we should still be
supporting the old chat anyways because it contains a plethora of useful
BYOND information that we still can really leverage (such as the
built-in profiler and stuff like that) and it's going to be painful to
do that if you have to keep spamming `fix-chat` to see OOC/ASAY while
alternating every damn time.
## Why It's Good For The Game

It's ugly but we still need it. There's a reason why we still have it.
## Changelog
:cl:
fix: "Old Chat" (AKA: The old-styled non-TGUI raw-HTMLesque chat that
you might see when it prods you with the "Failed to load fancy chat!"
issue) should now get all text messages as expected.
/:cl:
  • Loading branch information
san7890 authored and dwasint committed Dec 24, 2023
1 parent 8a1cc06 commit 78f2904
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions code/controllers/subsystem/chat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ SUBSYSTEM_DEF(chat)

/datum/controller/subsystem/chat/proc/send_payload_to_client(client/target, datum/chat_payload/payload)
target.tgui_panel.window.send_message("chat/message", payload.into_message())
SEND_TEXT(target, payload.get_content_as_html())

/datum/controller/subsystem/chat/fire()
for(var/ckey in client_to_payloads)
Expand Down
4 changes: 4 additions & 0 deletions code/datums/chat_payload.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
/// Converts the chat payload into a JSON string
/datum/chat_payload/proc/into_message()
return "{\"sequence\":[sequence],\"content\":[json_encode(content)]}"

/// Returns an HTML-encoded message from our contents.
/datum/chat_payload/proc/get_content_as_html()
return message_to_html(content)

0 comments on commit 78f2904

Please sign in to comment.