From 1cc266c675e7b7ff221ceb6544aca711c00e4569 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Mon, 23 Jan 2023 13:11:07 +0100 Subject: [PATCH] fix: Just use shouldEncryptElement for the envelope "validation" --- .../moxxmpp/lib/src/xeps/xep_0384/xep_0384.dart | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/packages/moxxmpp/lib/src/xeps/xep_0384/xep_0384.dart b/packages/moxxmpp/lib/src/xeps/xep_0384/xep_0384.dart index c6d9f40..a34502d 100644 --- a/packages/moxxmpp/lib/src/xeps/xep_0384/xep_0384.dart +++ b/packages/moxxmpp/lib/src/xeps/xep_0384/xep_0384.dart @@ -462,18 +462,8 @@ abstract class BaseOmemoManager extends XmppManagerBase { final envelopeChildren = envelope.firstTag('content')?.children; if (envelopeChildren != null) { children.addAll( - envelopeChildren - // Do not add forbidden elements from the envelope - .where((XMLNode child) { - for (final ignore in _doNotEncryptList) { - final xmlns = child.attributes['xmlns'] ?? ''; - if (child.tag == ignore.tag && xmlns == ignore.xmlns) { - return false; - } - } - - return true; - }), + // Do not add forbidden elements from the envelope + envelopeChildren.where(shouldEncryptElement), ); } else { logger.warning('Invalid envelope element: No element');