mirror of
https://github.com/chatmail/core.git
synced 2026-04-23 00:16:34 +03:00
feat: Group and broadcast channel descriptions (#7829)
fix https://github.com/chatmail/core/issues/7766 Implementation notes: - Descriptions are only sent with member additions, when the description is changed, and when promoting a previously-unpromoted group, in order not to waste bandwith. - Descriptions are not loaded everytime a chat object is loaded, because they are only needed for the profile. Instead, they are in their own table, and can be loaded with their own JsonRPC call. --------- Co-authored-by: iequidoo <117991069+iequidoo@users.noreply.github.com>
This commit is contained in:
@@ -186,10 +186,10 @@ pub enum SystemMessage {
|
||||
#[default]
|
||||
Unknown = 0,
|
||||
|
||||
/// Group name changed.
|
||||
/// Group or broadcast channel name changed.
|
||||
GroupNameChanged = 2,
|
||||
|
||||
/// Group avatar changed.
|
||||
/// Group or broadcast channel avatar changed.
|
||||
GroupImageChanged = 3,
|
||||
|
||||
/// Member was added to the group.
|
||||
@@ -254,6 +254,9 @@ pub enum SystemMessage {
|
||||
|
||||
/// Message indicating that a call was ended.
|
||||
CallEnded = 67,
|
||||
|
||||
/// Group or broadcast channel description changed.
|
||||
GroupDescriptionChanged = 70,
|
||||
}
|
||||
|
||||
const MIME_AC_SETUP_FILE: &str = "application/autocrypt-setup";
|
||||
@@ -773,6 +776,11 @@ impl MimeMessage {
|
||||
self.is_system_message = SystemMessage::MemberAddedToGroup;
|
||||
} else if self.get_header(HeaderDef::ChatGroupNameChanged).is_some() {
|
||||
self.is_system_message = SystemMessage::GroupNameChanged;
|
||||
} else if self
|
||||
.get_header(HeaderDef::ChatGroupDescriptionChanged)
|
||||
.is_some()
|
||||
{
|
||||
self.is_system_message = SystemMessage::GroupDescriptionChanged;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user