changeset 289:f08f8536cab8

mod delegation: extensions management (XEP-0128)
author Goffi <goffi@goffi.org>
date Sat, 18 Apr 2015 00:15:01 +0200
parents 073161f6f143
children 9f612fa19eea
files sat_pubsub/delegation.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sat_pubsub/delegation.py	Fri Apr 17 21:09:37 2015 +0200
+++ b/sat_pubsub/delegation.py	Sat Apr 18 00:15:01 2015 +0200
@@ -25,6 +25,7 @@
 
 from wokkel.subprotocols import XMPPHandler
 from wokkel import pubsub
+from wokkel import data_form
 from wokkel import disco, iwokkel
 from twisted.python import log
 from twisted.words.protocols.jabber import error
@@ -108,6 +109,10 @@
             for info in infos:
                 if isinstance(info, disco.DiscoFeature) and info.startswith(namespace):
                     ns_features.append(info)
+                elif (isinstance(info, data_form.Form) and info.formNamespace
+                    and info.formNamespace.startwith(namespace)):
+                    # extensions management (XEP-0128)
+                    ns_features.append(info)
 
             if namespace == pubsub.NS_PUBSUB:
                 ns_features.append(disco.DiscoIdentity('pubsub', 'pep'))