Skip to content

Commit

Permalink
Fixes oldchat
Browse files Browse the repository at this point in the history
  • Loading branch information
Git-Nivrak committed Jul 4, 2024
1 parent 7bd9347 commit 9b0717a
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 @@ -54,6 +54,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 9b0717a

Please sign in to comment.