From 95723fb6497d99ddc73a008c5ae0f4d44acdad9d Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 28 Aug 2016 20:33:28 +0100 Subject: OTR plugin: Implement XEP-0378 (OTR Discovery) --- doc/source/dev/xep.rst | 2 ++ plugins/otr.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/doc/source/dev/xep.rst b/doc/source/dev/xep.rst index 66d99e95..cb06d2c8 100644 --- a/doc/source/dev/xep.rst +++ b/doc/source/dev/xep.rst @@ -75,3 +75,5 @@ Table of all XEPs implemented in poezio. +----------+-------------------------+---------------------+ |0364 |Current OTR Usage |100% | +----------+-------------------------+---------------------+ +|0378 |OTR Discovery |100% | ++----------+-------------------------+---------------------+ diff --git a/plugins/otr.py b/plugins/otr.py index 1f41cf71..cffe1797 100644 --- a/plugins/otr.py +++ b/plugins/otr.py @@ -493,6 +493,8 @@ class Plugin(BasePlugin): ConversationTab.add_information_element('otr', self.display_encryption_status) PrivateTab.add_information_element('otr', self.display_encryption_status) + self.core.xmpp.plugin['xep_0030'].add_feature('urn:xmpp:otr:0') + self.account = PoezioAccount(self.core.xmpp.boundjid.bare, OTR_DIR) self.account.load_trusts() self.contexts = {} @@ -531,6 +533,8 @@ class Plugin(BasePlugin): for context in self.contexts.values(): context.disconnect() + self.core.xmpp.plugin['xep_0030'].del_feature(feature='urn:xmpp:otr:0') + ConversationTab.remove_information_element('otr') PrivateTab.remove_information_element('otr') -- cgit v1.2.3