diff options
author | Maxime Buquet <pep@bouah.net> | 2020-01-11 13:23:06 +0100 |
---|---|---|
committer | Maxime Buquet <pep@bouah.net> | 2020-01-11 13:23:06 +0100 |
commit | 6b2110329b712af1f15c2c521b21ed650e8e8537 (patch) | |
tree | 5ae0fd3731c5cdbae1d6658162555091f243be89 | |
parent | 30a7ac052a6cf6fec46f96e48c17c51246923a1d (diff) | |
parent | 09a3cb2152244a40d68f21fde8a651922c4a9345 (diff) | |
download | poezio-6b2110329b712af1f15c2c521b21ed650e8e8537.tar.gz poezio-6b2110329b712af1f15c2c521b21ed650e8e8537.tar.bz2 poezio-6b2110329b712af1f15c2c521b21ed650e8e8537.tar.xz poezio-6b2110329b712af1f15c2c521b21ed650e8e8537.zip |
Merge branch 'e2ee-muc' into 'master'
Prevent plugin_e2ee from sending empty JID as recipient
See merge request poezio/poezio!56
-rw-r--r-- | poezio/plugin_e2ee.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/poezio/plugin_e2ee.py b/poezio/plugin_e2ee.py index daf00818..9d1d4903 100644 --- a/poezio/plugin_e2ee.py +++ b/poezio/plugin_e2ee.py @@ -428,12 +428,15 @@ class E2EEPlugin(BasePlugin): break # If we encrypt to all of these JIDs is up to the plugin, we # just tell it who is in the room. - jids.append(user.jid) + # XXX: user.jid shouldn't be empty. That's a MucTab/slixmpp + # bug. + if user.jid.bare: + jids.append(user.jid) if not self._encryption_enabled(tab.jid): raise NothingToEncrypt() - log.debug('Sending %s message: %r', self.encryption_name, message) + log.debug('Sending %s message', self.encryption_name) has_body = message.xml.find('{%s}%s' % (JCLIENT_NS, 'body')) is not None @@ -441,10 +444,9 @@ class E2EEPlugin(BasePlugin): # Stanza Encryption if not self.stanza_encryption and not has_body: log.debug( - '%s plugin: Dropping message as it contains no body, and is ' - 'not doesn\'t do stanza encryption: %r', + '%s plugin: Dropping message as it contains no body, and ' + 'not doesn\'t do stanza encryption', self.encryption_name, - message, ) return None @@ -483,7 +485,7 @@ class E2EEPlugin(BasePlugin): if elem.tag not in tag_whitelist: message.xml.remove(elem) - log.debug('Encrypted %s message: %r', self.encryption_name, message) + log.debug('Encrypted %s message', self.encryption_name) return message def store_trust(self, jid: JID, state: str, fingerprint: str) -> None: |