mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 22:36:30 +03:00
fix: Securejoin: Mark 1:1s as protected regardless of the Config::VerifiedOneOnOneChats
As per the comment in `receive_imf.rs`, `chat.protected` must be maintained regardless of the `Config::VerifiedOneOnOneChats`. The only thing that mustn't be done if `VerifiedOneOnOneChats` is unset (i.e. for non-supporting UIs) is marking chats as "protection broken" because this needs showing the corresponding dialog to a user.
This commit is contained in:
@@ -2454,21 +2454,19 @@ async fn mark_recipients_as_verified(
|
||||
peerstate.set_verified(PeerstateKeyType::GossipKey, fp, verifier_addr)?;
|
||||
peerstate.save_to_db(&context.sql).await?;
|
||||
|
||||
if !is_verified {
|
||||
let (to_contact_id, _) = Contact::add_or_lookup(
|
||||
context,
|
||||
"",
|
||||
&ContactAddress::new(&to_addr)?,
|
||||
Origin::Hidden,
|
||||
)
|
||||
.await?;
|
||||
ChatId::set_protection_for_contact(
|
||||
context,
|
||||
to_contact_id,
|
||||
mimeparser.timestamp_sent,
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
let (to_contact_id, _) = Contact::add_or_lookup(
|
||||
context,
|
||||
"",
|
||||
&ContactAddress::new(&to_addr)?,
|
||||
Origin::Hidden,
|
||||
)
|
||||
.await?;
|
||||
ChatId::set_protection_for_contact(
|
||||
context,
|
||||
to_contact_id,
|
||||
mimeparser.timestamp_sent,
|
||||
)
|
||||
.await?;
|
||||
}
|
||||
} else {
|
||||
// The contact already has a verified key.
|
||||
|
||||
Reference in New Issue
Block a user