From b9abd60673cca31fd853eaea78a08323a5c4a47f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sun, 18 Jul 2021 23:30:46 +0200 Subject: plugin_e2ee: Add TODO in _encrypt filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- poezio/plugin_e2ee.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/poezio/plugin_e2ee.py b/poezio/plugin_e2ee.py index ba0e6cd7..1f674d99 100644 --- a/poezio/plugin_e2ee.py +++ b/poezio/plugin_e2ee.py @@ -431,6 +431,16 @@ class E2EEPlugin(BasePlugin): return None async def _encrypt(self, stanza: StanzaBase, passthrough: bool = True) -> Optional[StanzaBase]: + # TODO: Let through messages that contain elements that don't need to + # be encrypted even in an encrypted context, such as MUC mediated + # invites, etc. + # What to do when they're mixed with other elements? It probably + # depends on the element. Maybe they can be mixed with + # `self.tag_whitelist` that are already assumed to be sent as plain by + # the E2EE plugin. + # They might not be accompanied by a most of the time, nor by + # an encrypted tag. + if not isinstance(stanza, Message) or stanza['type'] not in ('normal', 'chat', 'groupchat'): raise NothingToEncrypt() message = stanza -- cgit v1.2.3