Fix failure to decrypt first message to self after key change

The problem was in the handle_fingerprint_change() function which
attempted to add a warning about fingerprint change to all chats with
the contact.

This failed because of the SQL query failing to find the contact for
self in the `contacts` table. So the warning was not added, but at the
same time the whole decryption process failed.

The fix is to skip handle_fingerprint_change() for self addreses.
This commit is contained in:
link2xt
2022-05-22 22:59:36 +00:00
parent 1d522edb01
commit 9c41f0fdb9
3 changed files with 52 additions and 0 deletions

View File

@@ -267,6 +267,11 @@ impl Peerstate {
context: &Context,
timestamp: i64,
) -> Result<()> {
if context.is_self_addr(&self.addr).await? {
// Do not try to search all the chats with self.
return Ok(());
}
if self.fingerprint_changed {
if let Some(contact_id) = context
.sql