pda_chat ![code/modules/modular_computers/file_system/programs/messenger/messenger_data.dm 52](git.png)
Chat log data type, stores information about the recipient, the messages themselves and other metadata.
Vars | |
cached_job | The cached job of the recipient |
---|---|
cached_name | The cached name of the recipient, so we can identify this chat even after the recipient is deleted |
can_reply | Used to determine if you can talk in a chat |
message_draft | Saved draft of a message so the sender can leave and come back later |
messages | A list of messages in this chat |
recipient | Weakref to the recipient messenger |
unread_messages | Number of unread messages in this chat |
visible_in_recents | Used to determine if we should show this in recents |
Procs | |
add_message | Adds a message to the chat log and optionally shows the chat in recents. Call this instead of adding to messages directly. |
get_recipient_job | Returns the messenger's job, caches the job in case the recipient becomes invalid later. |
get_recipient_name | Returns the messenger's name, caches the name in case the recipient becomes invalid later. |
get_ui_data | Returns this datum as an associative list, used for ui_data calls. |
Var Details
cached_job ![code/modules/modular_computers/file_system/programs/messenger/messenger_data.dm 57](git.png)
The cached job of the recipient
cached_name ![code/modules/modular_computers/file_system/programs/messenger/messenger_data.dm 55](git.png)
The cached name of the recipient, so we can identify this chat even after the recipient is deleted
can_reply ![code/modules/modular_computers/file_system/programs/messenger/messenger_data.dm 65](git.png)
Used to determine if you can talk in a chat
message_draft ![code/modules/modular_computers/file_system/programs/messenger/messenger_data.dm 67](git.png)
Saved draft of a message so the sender can leave and come back later
messages ![code/modules/modular_computers/file_system/programs/messenger/messenger_data.dm 61](git.png)
A list of messages in this chat
recipient ![code/modules/modular_computers/file_system/programs/messenger/messenger_data.dm 59](git.png)
Weakref to the recipient messenger
unread_messages ![code/modules/modular_computers/file_system/programs/messenger/messenger_data.dm 69](git.png)
Number of unread messages in this chat
visible_in_recents ![code/modules/modular_computers/file_system/programs/messenger/messenger_data.dm 63](git.png)
Used to determine if we should show this in recents
Proc Details
add_message
Adds a message to the chat log and optionally shows the chat in recents. Call this instead of adding to messages directly.
get_recipient_job
Returns the messenger's job, caches the job in case the recipient becomes invalid later.
get_recipient_name
Returns the messenger's name, caches the name in case the recipient becomes invalid later.
get_ui_data
Returns this datum as an associative list, used for ui_data calls.