Expand description
Β§Chat module.
StructsΒ§
- Chat
- An object representing a single chat in memory.
Chat objects are created using eg.
Chat::load_from_db
and are not updated on database changes; if you want an update, you have to recreate the object. - ChatId
- Chat ID, including reserved IDs.
- Chat
IdBlocked π - Handle a
ChatId
and itsBlocked
status at once. - Chat
Info - The current state of a chat.
- Chat
Visibility Iter - An iterator over the variants of ChatVisibility
- Message
List Options - Chat message list request options.
EnumsΒ§
- Cant
Send πReason - The reason why messages cannot be sent to the chat.
- Chat
Item - An chat item, such as a message or a marker.
- Chat
Visibility - Whether the chat is pinned or archived.
- Mute
Duration - Chat mute duration.
- Protection
Status - Chat protection status.
- Sync
Action π - An action synchronised to other devices.
- SyncId π
- A cross-device chat id used for synchronisation.
FunctionsΒ§
- add_
contact_ to_ chat - Adds a contact to the chat. If the group is promoted, also sends out a system message to all group members
- add_
contact_ πto_ chat_ ex - add_
device_ msg - Adds a message to device chat.
- add_
device_ msg_ with_ importance - Adds a message to device chat.
- add_
info_ πmsg - Adds info message with a given text and
timestamp
to the chat. - add_
info_ πmsg_ with_ cmd - Adds an informational message to chat.
- add_
to_ πchat_ contacts_ table - Adds contacts to the
chats_contacts
table. - create_
broadcast_ list - Creates a new broadcast list.
- create_
broadcast_ πlist_ ex - create_
group_ chat - Creates a group chat with a given
name
. - create_
send_ πmsg_ jobs - Constructs jobs for sending a message and inserts them into the appropriate table.
- delete_
and_ πreset_ all_ device_ msgs - find_
unused_ πbroadcast_ list_ name - Finds an unused name for a new broadcast list.
- forward_
msgs - Forwards multiple messages to a chat.
- get_
address_ πcontact_ icon - get_
archive_ πicon - get_
asset_ πicon - get_
broadcast_ πicon - get_
chat_ πcnt - get_
chat_ contacts - Returns a vector of contact IDs for given chat ID.
- get_
chat_ πid_ by_ grpid - Returns a tuple of
(chatid, is_protected, blocked)
. - get_
chat_ media - Returns all database message IDs of the given types.
- get_
chat_ msgs - Returns all messages belonging to the chat.
- get_
chat_ msgs_ ex - Returns messages belonging to the chat according to the given options.
- get_
device_ πicon - get_
past_ chat_ contacts - Returns a vector of contact IDs for given chat ID that are no longer part of the group.
- get_
saved_ πmessages_ icon - is_
contact_ in_ chat - Returns whether a contact is in a chat or not.
- is_
group_ πexplicitly_ left - mark_
old_ πmessages_ as_ noticed - Marks messages preceding outgoing messages as noticed.
- marknoticed_
chat - Marks all messages in the chat as noticed. If the given chat-id is the archive-link, marks all messages in all archived chats as noticed.
- prepare_
msg_ πblob - prepare_
send_ πmsg - Prepares a message to be sent out.
- remove_
contact_ from_ chat - Removes contact from the chat.
- remove_
from_ πchat_ contacts_ table - Removes a contact from the chat
by updating the
remove_timestamp
. - rename_
ex π - resend_
msgs - Resends given messages with the same Message-ID.
- save_
copy_ πin_ self_ talk - Saves a copy of the given message in βSaved Messagesβ using the given RFC724 id.
To allow UIs to have a βshow in contextβ button,
the copy contains a reference to the original message
as well as to the original chat in case the original message gets deleted.
Returns data needed to add a
SaveMessage
sync item. - save_
msgs - Save a copy of the message in βSaved Messagesβ and send a sync messages so that other devices save the message as well, unless deleted there.
- save_
text_ πedit_ to_ db - send_
edit_ request - Sends chat members a request to edit the given messageβs text.
- send_
msg - Sends a message object to a chat.
- send_
msg_ sync - Tries to send a message synchronously.
- send_
text_ msg - Sends a text message to the given chat.
- send_
videochat_ invitation - Sends invitation to a videochat.
- set_
chat_ name - Sets group or mailing list chat name.
- set_
chat_ profile_ image - Sets a new profile image for the chat.
- set_
contacts_ πby_ addrs - Set chat contacts by their addresses creating the corresponding contacts if necessary.
- set_
contacts_ πby_ fingerprints - Set chat contacts by their fingerprints creating the corresponding contacts if necessary.
- set_
group_ πexplicitly_ left - set_
muted - Mutes the chat for a given duration or unmutes it.
- set_
muted_ πex - shall_
attach_ πselfavatar - Returns true if an avatar should be attached in the given chat.
- sync π
- update_
chat_ πcontacts_ table - Set chat contacts in the
chats_contacts
table. - update_
msg_ πtext_ and_ timestamp - update_
special_ πchat_ name - update_
special_ πchat_ names - was_
device_ msg_ ever_ added - Returns true if device message with a given label was ever added to the device chat.