WIP, untested: Receiving side of passing broadcast secret in a message

This commit is contained in:
Hocuri
2025-08-06 16:36:44 +02:00
parent 0978a46ab6
commit e1abaebeb5

View File

@@ -16,6 +16,7 @@ use regex::Regex;
use crate::chat::{
self, Chat, ChatId, ChatIdBlocked, ProtectionStatus, remove_from_chat_contacts_table,
save_broadcast_shared_secret,
};
use crate::config::Config;
use crate::constants::{self, Blocked, Chattype, DC_CHAT_ID_TRASH, EDITED_PREFIX, ShowEmails};
@@ -3567,6 +3568,10 @@ async fn apply_in_broadcast_changes(
}
}
if let Some(secret) = mime_parser.get_header(HeaderDef::ChatBroadcastSecret) {
save_broadcast_shared_secret(context, chat.id, secret).await?;
}
if send_event_chat_modified {
context.emit_event(EventType::ChatModified(chat.id));
chatlist_events::emit_chatlist_item_changed(context, chat.id);