feat: Add cancelReason if recipient likely does not support OMEMO:2

This commit is contained in:
PapaTutuWawa 2023-01-21 15:42:00 +01:00
parent 6c63b53cf4
commit e031e6d760

View File

@ -357,6 +357,11 @@ abstract class BaseOmemoManager extends XmppManagerBase {
other['encryption_error_devices'] = result.deviceEncryptionErrors;
return state.copyWith(
other: other,
// If we have no device list for toJid, then the contact most likely does not
// support OMEMO:2
cancelReason: result.jidEncryptionErrors[toJid.toString()] is NoKeyMaterialAvailableException ?
OmemoNotSupportedForContactException() :
null,
cancel: true,
);
}