mirror of
https://github.com/chatmail/core.git
synced 2026-05-09 01:46:30 +03:00
WIP, untested: Receiving side of passing broadcast secret in a message
This commit is contained in:
@@ -3497,6 +3497,17 @@ async fn apply_in_broadcast_changes(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(secret) = mime_parser.get_header(HeaderDef::ChatBroadcastSecret) {
|
||||||
|
context
|
||||||
|
.sql
|
||||||
|
.execute(
|
||||||
|
"INSERT INTO broadcasts_shared_secrets (chat_id, secret) VALUES (?, ?)
|
||||||
|
ON CONFLICT(chat_id) DO UPDATE SET secret=excluded.chat_id",
|
||||||
|
(chat.id, secret),
|
||||||
|
)
|
||||||
|
.await?;
|
||||||
|
}
|
||||||
|
|
||||||
if send_event_chat_modified {
|
if send_event_chat_modified {
|
||||||
context.emit_event(EventType::ChatModified(chat.id));
|
context.emit_event(EventType::ChatModified(chat.id));
|
||||||
chatlist_events::emit_chatlist_item_changed(context, chat.id);
|
chatlist_events::emit_chatlist_item_changed(context, chat.id);
|
||||||
|
|||||||
Reference in New Issue
Block a user