Module chat

Source
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.
ChatIdBlocked πŸ”’
Handle a ChatId and its Blocked status at once.
ChatInfo
The current state of a chat.
ChatVisibilityIter
An iterator over the variants of ChatVisibility
MessageListOptions
Chat message list request options.

EnumsΒ§

CantSendReason πŸ”’
The reason why messages cannot be sent to the chat.
ChatItem
An chat item, such as a message or a marker.
ChatVisibility
Whether the chat is pinned or archived.
MuteDuration
Chat mute duration.
ProtectionStatus
Chat protection status.
SyncAction πŸ”’
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_archive_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_past_chat_contacts
Returns a vector of contact IDs for given chat ID that are no longer part of the group.
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.
resume_securejoin_wait πŸ”’
Checks if there is a 1:1 chat in-progress SecureJoin for Bob and, if necessary, schedules a task unblocking the chat and notifying the user accordingly.
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_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_device_icon πŸ”’
update_msg_text_and_timestamp πŸ”’
update_saved_messages_icon πŸ”’
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.