Skip to content

Commit 70ab41d

Browse files
committed
WIP, untested: Receiving side of passing broadcast secret in a message
1 parent fab39fd commit 70ab41d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/receive_imf.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3497,6 +3497,17 @@ async fn apply_in_broadcast_changes(
34973497
}
34983498
}
34993499

3500+
if let Some(secret) = mime_parser.get_header(HeaderDef::ChatBroadcastSecret) {
3501+
context
3502+
.sql
3503+
.execute(
3504+
"INSERT INTO broadcasts_shared_secrets (chat_id, secret) VALUES (?, ?)
3505+
ON CONFLICT(chat_id) DO UPDATE SET secret=excluded.chat_id",
3506+
(chat.id, secret),
3507+
)
3508+
.await?;
3509+
}
3510+
35003511
if send_event_chat_modified {
35013512
context.emit_event(EventType::ChatModified(chat.id));
35023513
chatlist_events::emit_chatlist_item_changed(context, chat.id);

0 commit comments

Comments
 (0)