Skip to content

Commit

Permalink
fix: do not add protection messages to Saved Messages chat
Browse files Browse the repository at this point in the history
This causes troubles such as adding this message
the first time a sync message is sent.
  • Loading branch information
link2xt committed Nov 29, 2024
1 parent 9ec1401 commit 948cefa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/chat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 948cefa

Please sign in to comment.