mirror of
https://github.com/chatmail/core.git
synced 2026-04-26 01:46:34 +03:00
sync broadcast secret for multidevice
This commit is contained in:
@@ -3477,8 +3477,22 @@ async fn apply_out_broadcast_changes(
|
||||
chat: &mut Chat,
|
||||
from_id: ContactId,
|
||||
) -> Result<GroupChangesInfo> {
|
||||
// TODO code duplication with apply_in_broadcast_changes()
|
||||
ensure!(chat.typ == Chattype::OutBroadcast);
|
||||
|
||||
let mut send_event_chat_modified = false;
|
||||
let mut better_msg = None;
|
||||
|
||||
apply_chat_name_and_avatar_changes(
|
||||
context,
|
||||
mime_parser,
|
||||
from_id,
|
||||
chat,
|
||||
&mut send_event_chat_modified,
|
||||
&mut better_msg,
|
||||
)
|
||||
.await?;
|
||||
|
||||
if let Some(_removed_addr) = mime_parser.get_header(HeaderDef::ChatGroupMemberRemoved) {
|
||||
// The sender of the message left the broadcast channel
|
||||
remove_from_chat_contacts_table(context, chat.id, from_id).await?;
|
||||
@@ -3491,7 +3505,16 @@ async fn apply_out_broadcast_changes(
|
||||
});
|
||||
}
|
||||
|
||||
Ok(GroupChangesInfo::default())
|
||||
if send_event_chat_modified {
|
||||
context.emit_event(EventType::ChatModified(chat.id));
|
||||
chatlist_events::emit_chatlist_item_changed(context, chat.id);
|
||||
}
|
||||
Ok(GroupChangesInfo {
|
||||
better_msg,
|
||||
added_removed_id: None,
|
||||
silent: false,
|
||||
extra_msgs: vec![],
|
||||
})
|
||||
}
|
||||
|
||||
async fn apply_in_broadcast_changes(
|
||||
|
||||
Reference in New Issue
Block a user