fix: Just use shouldEncryptElement for the envelope "validation"
This commit is contained in:
parent
72099dfde5
commit
1cc266c675
@ -462,18 +462,8 @@ abstract class BaseOmemoManager extends XmppManagerBase {
|
|||||||
final envelopeChildren = envelope.firstTag('content')?.children;
|
final envelopeChildren = envelope.firstTag('content')?.children;
|
||||||
if (envelopeChildren != null) {
|
if (envelopeChildren != null) {
|
||||||
children.addAll(
|
children.addAll(
|
||||||
envelopeChildren
|
|
||||||
// Do not add forbidden elements from the envelope
|
// Do not add forbidden elements from the envelope
|
||||||
.where((XMLNode child) {
|
envelopeChildren.where(shouldEncryptElement),
|
||||||
for (final ignore in _doNotEncryptList) {
|
|
||||||
final xmlns = child.attributes['xmlns'] ?? '';
|
|
||||||
if (child.tag == ignore.tag && xmlns == ignore.xmlns) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}),
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
logger.warning('Invalid envelope element: No <content /> element');
|
logger.warning('Invalid envelope element: No <content /> element');
|
||||||
|
Loading…
Reference in New Issue
Block a user