summaryrefslogtreecommitdiff
path: root/poezio/plugin_e2ee.py
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2019-07-02 01:12:22 +0200
committerMaxime “pep” Buquet <pep@bouah.net>2019-07-02 01:12:22 +0200
commit12c5310e5b5c0da40f507c60bc9d1b28479b3bd9 (patch)
treed91358f02a67f5992fceca85d11ed809780699c4 /poezio/plugin_e2ee.py
parenta166fcb5a3d19653dd445f0e9db68802502f5987 (diff)
downloadpoezio-12c5310e5b5c0da40f507c60bc9d1b28479b3bd9.tar.gz
poezio-12c5310e5b5c0da40f507c60bc9d1b28479b3bd9.tar.bz2
poezio-12c5310e5b5c0da40f507c60bc9d1b28479b3bd9.tar.xz
poezio-12c5310e5b5c0da40f507c60bc9d1b28479b3bd9.zip
poezio/plugin_e2ee: Use encrypted_tags attribute to complete whitelist filtering on encryption
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
Diffstat (limited to 'poezio/plugin_e2ee.py')
-rw-r--r--poezio/plugin_e2ee.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/poezio/plugin_e2ee.py b/poezio/plugin_e2ee.py
index 91b1a22e..357a9678 100644
--- a/poezio/plugin_e2ee.py
+++ b/poezio/plugin_e2ee.py
@@ -251,8 +251,12 @@ class E2EEPlugin(BasePlugin):
# Filter stanza with the whitelist. Plugins doing stanza encryption
# will have to include these in their encrypted container beforehand.
+ whitelist = self.tag_whitelist
+ if self.encrypted_tags is not None:
+ whitelist += self.encrypted_tags
+
for elem in message.xml[:]:
- if elem.tag not in self.tag_whitelist:
+ if elem.tag not in whitelist:
message.xml.remove(elem)
log.debug('Encrypted %s message: %r', self.encryption_name, message)