Skip to content

Commit 948cefa

Browse files
committed
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.
1 parent 9ec1401 commit 948cefa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: src/chat.rs

+8
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,14 @@ impl ChatId {
567567
contact_id: Option<ContactId>,
568568
timestamp_sort: i64,
569569
) -> Result<()> {
570+
if contact_id == Some(ContactId::SELF) {
571+
// Do not add protection messages to Saved Messages chat.
572+
// This chat never gets protected and unprotected,
573+
// we do not want the first message
574+
// to be a protection message with an arbitrary timestamp.
575+
return Ok(());
576+
}
577+
570578
let text = context.stock_protection_msg(protect, contact_id).await;
571579
let cmd = match protect {
572580
ProtectionStatus::Protected => SystemMessage::ChatProtectionEnabled,

0 commit comments

Comments
 (0)