fix: Allow empty OMEMO messages to bypass trust

This commit is contained in:
PapaTutuWawa committed 2022-08-09 14:45:04 +02:00
1 parent fa16f97113
commit cb43bbb112
3 files changed
+50 -2

No files matched your search

+5 -2
View File
@@ -224,8 +224,11 @@ class OmemoSessionManager {
// We assume that the user already checked if the session exists
for (final jid in jids) {
for (final deviceId in _deviceMap[jid]!) {
// Only encrypt to devices that are trusted
if (!(await _trustManager.isTrusted(jid, deviceId))) continue;
// Empty OMEMO messages are allowed to bypass trust
if (plaintext != null) {
// Only encrypt to devices that are trusted
if (!(await _trustManager.isTrusted(jid, deviceId))) continue;
}
final ratchetKey = RatchetMapKey(jid, deviceId);
final ratchet = _ratchetMap[ratchetKey]!;