/tg/ Station 13 - Modules - TypesVar Details - Proc Details

pda_chat

Chat log data type, stores information about the recipient, the messages themselves and other metadata.

Vars

cached_jobThe cached job of the recipient
cached_nameThe cached name of the recipient, so we can identify this chat even after the recipient is deleted
can_replyUsed to determine if you can talk in a chat
message_draftSaved draft of a message so the sender can leave and come back later
messagesA list of messages in this chat
recipientWeakref to the recipient messenger
unread_messagesNumber of unread messages in this chat
visible_in_recentsUsed to determine if we should show this in recents

Procs

add_messageAdds a message to the chat log and optionally shows the chat in recents. Call this instead of adding to messages directly.
get_recipient_jobReturns the messenger's job, caches the job in case the recipient becomes invalid later.
get_recipient_nameReturns the messenger's name, caches the name in case the recipient becomes invalid later.
get_ui_dataReturns this datum as an associative list, used for ui_data calls.

Var Details

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

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.