Commit Graph

6 Commits

Author SHA1 Message Date
SkyratBot
be7bcfc0ab [MIRROR] Fixes OOC chat avoid_highlighting (#7128)
* Fixes OOC chat avoid_highlighting (#60413)

Adds `avoid_highlighting` args to OOC `to_chat()` calls.

Passes `avoid_highlighting` through to `to_chat_immediate()` before SSchat is ready.

* Fixes OOC chat avoid_highlighting

Co-authored-by: Wayland-Smithy <64715958+Wayland-Smithy@users.noreply.github.com>
2021-07-26 15:47:53 +01:00
SkyratBot
44f34fac20 [MIRROR] The to_chat proc no longer accepts null or empty strings and runtimes instead. (#6570)
* The to_chat proc no longer accepts null or empty strings and runtimes instead. (#59843)

* Catch null text sent to to_chat

* Brain traumas no longer send empty to_chat gain strings

* Make to_chat_immediate changes and clean up args list formatting

* Fix empty to_chat message where there is no memo for admins

* Fix additional edge case where there are no messages for the ckey.

* The to_chat proc no longer accepts null or empty strings and runtimes instead.

Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
2021-06-28 14:18:18 +01:00
SkyratBot
c487c73f39 [MIRROR] Grep for space indentation (#1969)
* Grep for space indentation

* aa

* Update species.dm

* Update species.dm

* Update maps.dm

* Update examine.dm

Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
Co-authored-by: Azarak <azarak10@gmail.com>
2020-12-01 12:26:41 +01:00
SkyratBot
ec28f27bf8 [MIRROR] Fix broken dmdoc crosslinks (#933)
* Fix broken dmdoc crosslinks

* Update species.dm

Co-authored-by: Tad Hardesty <tad@platymuus.com>
Co-authored-by: Azarak <azarak10@gmail.com>
2020-09-23 15:14:45 +02:00
SkyratBot
5246c4cd65 [MIRROR] Messages sent by yourself no longer highlight (#377)
* Messages sent by yourself no longer highlight (#52991)

* Messages sent by yourself no longer highlight

Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
2020-08-18 15:47:11 +01:00
SkyratBot
971b0ba1de [MIRROR] tgchat: Hotfixes, Message Annotations (#364)
* tgchat: Hotfixes, Message Annotations (#52947)

This PR changes the message pipeline a little bit to support list-based messages, which can be annotated with custom data. Function signature of to_chat was slightly changed as well:

// Plain text message
to_chat(client,
  type = MESSAGE_TYPE_INFO,
  text = "foo")

// HTML message
to_chat(client,
  type = MESSAGE_TYPE_INFO,
  html = "<span class='notice'>foo</span>")

Old to_chat format is still supported, but handle_whitespace, trailing_newline and confidential flags have no effect. confidential flag could still be revived though, if there is enough merit in it, for example to filter out confidential messages when saving a chat log.

The reason for using /list and not /datum, is because lists are plain faster, and there are minimal data transformations - these lists are fed directly to json_encode and sent to tgchat.

Plain text messages do not need to be HTML-escaped, which makes them safer and more performant than HTML messages. Plain text messages can be made interactive (or formatted with CSS) by custom-handling them in javscript based on message type and annotations.

It would be impossible to annotate every single message in the game (at the moment of writing, there are 9447 to_chat calls in the code), but it could be done selectively, for only those messages that are hard to classify by span classes (and there are still A LOT of them).
Please annotate more messages. Thank you.

    Fixes #52943
    Fixes #52908
    Fixes #52816

Changelog

cl
add: tgchat: Unread message count is now smarter and won't increase on other tabs if you have already read the same message in the active tab.
add: tgchat: Admin PMs are now properly annotated and can be filtered into separate tabs.
fix: tgchat: Fix: Highlighted message overlay no longer blocks clicks. Clicking a highlighted (F) link should work as it should.
fix: tgui: Fixed NTOS bluescreen due to calling .includes() on a stylesheet href which could be null on certain browsers.
code: tgchat: Chat schema bumped to version 5. All chat-related settings were reset to avoid breakage.
/cl

* tgchat: Hotfixes, Message Annotations

Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
2020-08-17 14:48:28 +02:00