plugin_e2ee: Add TODO in _encrypt filter

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2021-07-18 23:30:46 +02:00
parent cfa1bfc5b2
commit b9abd60673

View file

@ -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 <body/> 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