fix: do not add protection messages to Saved Messages chat

This causes troubles such as adding this message
the first time a sync message is sent.
This commit is contained in:
link2xt
2023-11-12 11:03:21 +00:00
committed by l
parent 9ec1401a37
commit 948cefa3ef

View File

@@ -567,6 +567,14 @@ impl ChatId {
contact_id: Option<ContactId>,
timestamp_sort: i64,
) -> Result<()> {
if contact_id == Some(ContactId::SELF) {
// Do not add protection messages to Saved Messages chat.
// This chat never gets protected and unprotected,
// we do not want the first message
// to be a protection message with an arbitrary timestamp.
return Ok(());
}
let text = context.stock_protection_msg(protect, contact_id).await;
let cmd = match protect {
ProtectionStatus::Protected => SystemMessage::ChatProtectionEnabled,