fix: allow other verified group recipients to be unverified

We may not have a verified key for other members
because we lost a gossip message.
Still, if the message is signed with a verified key
of the sender, there is no reason to replace it with an error.
This commit is contained in:
link2xt
2023-10-28 21:53:42 +00:00
parent 6aae0276da
commit a93c79e001

View File

@@ -2326,13 +2326,7 @@ async fn has_verified_encryption(
let contact = Contact::get_by_id(context, from_id).await?;
for (to_addr, mut is_verified) in rows {
info!(
context,
"has_verified_encryption: {:?} self={:?}.",
to_addr,
context.is_self_addr(&to_addr).await
);
for (to_addr, is_verified) in rows {
let peerstate = Peerstate::from_addr(context, &to_addr).await?;
// mark gossiped keys (if any) as verified
@@ -2357,16 +2351,10 @@ async fn has_verified_encryption(
contact.get_addr().to_owned(),
)?;
peerstate.save_to_db(&context.sql).await?;
is_verified = true;
}
}
}
}
if !is_verified {
return Ok(NotVerified(format!(
"{to_addr} is not a member of this protected chat member list {to_ids:?}",
)));
}
}
Ok(Verified)
}