fix self-chat
iOS CI / Build and Test SwiftUI App (push) Canceled after 0s
Build Unsigned iOS and macOS Apps / Build Unsigned iOS IPA (push) Canceled after 0s
Build Unsigned iOS and macOS Apps / Build macOS ZIP (push) Canceled after 0s

This commit is contained in:
wt committed 2026-08-18 17:17:11 +07:00
1 parent f00c31f794
commit a717157734
2 files changed
+17 -6

No files matched your search

+8
View File
@@ -1460,6 +1460,14 @@ final class AppModel: ObservableObject {
}
func encryptionEnabled(for jid: String) -> Bool {
// A conversation with the account's own bare JID is a self-chat.
// OMEMO to oneself is meaningless and would force MartinOMEMO to build
// a cryptographically invalid self-session (see
// `LumaOMEMOStore.removeSessionWithOwnDevice`), producing messages
// that later fail to decrypt. Always send self-chat plaintext.
if let account, jid.lowercased() == account.normalizedJID {
return false
}
return encryptionPreference(for: jid).resolved(globalEnabled: globalEncryptionEnabled)
}