fix: Don't show wrong system message on Bob's second device

Before this, Bob's second device showed a system message
"⚠️ It seems you are using Delta Chat on multiple devices that cannot
decrypt each other's outgoing messages..."
This commit is contained in:
Hocuri
2025-08-16 19:46:42 +02:00
parent a3d1e3bc89
commit f7844e97c2
4 changed files with 20 additions and 12 deletions

View File

@@ -1386,15 +1386,16 @@ impl Message {
self.error.clone()
}
// TODO this function could be used a lot more
/// If this is a secure-join message,
/// returns the current step,
/// which is put into the `Secure-Join` header.
pub(crate) fn securejoin_step(&self) -> Option<&str> {
/// Returns `true` if this message is a `vb-request-with-auth` SecureJoin message.
pub(crate) fn is_vb_request_with_auth(&self) -> bool {
if self.param.get_cmd() == SystemMessage::SecurejoinMessage {
self.param.get(Param::Arg)
// CAVE: You can't check in the same way whether the message
// is a `v{g|b}-member-added` message,
// because for these messages,
// `param.get_cmd()` returns `SystemMessage::MemberAddedToGroup`.
self.param.get(Param::Arg) == Some("vb-request-with-auth")
} else {
None
false
}
}
}