feat: Sync Alice's verification on Bob's side

This commit is contained in:
Hocuri
2025-08-12 15:16:30 +02:00
parent 00ba559562
commit 40f4eea049
5 changed files with 51 additions and 32 deletions

View File

@@ -10,7 +10,7 @@ use crate::contact::Origin;
use crate::context::Context;
use crate::events::EventType;
use crate::key::self_fingerprint;
use crate::log::info;
use crate::log::{LogExt as _, info};
use crate::message::{Message, Viewtype};
use crate::mimeparser::{MimeMessage, SystemMessage};
use crate::param::Param;
@@ -81,6 +81,13 @@ pub(super) async fn start_protocol(context: &Context, invite: QrInvite) -> Resul
contact_id: invite.contact_id(),
progress: JoinerProgress::RequestWithAuthSent.to_usize(),
});
// Our second device won't be able to decrypt the outgoing message
// because it will be symmetrically encrypted with the AUTH token.
// So, we need to send a sync message:
let id = chat::SyncId::ContactFingerprint(invite.fingerprint().hex());
let action = chat::SyncAction::MarkVerified;
chat::sync(context, id, action).await.log_err(context).ok();
} else {
// Start the version 1 protocol and initialise the state.
let has_key = context