changeset 2688:943e78e18882

core (xmpp): added missing disco#info namespace to disco info result.
author Goffi <goffi@goffi.org>
date Sat, 10 Nov 2018 10:16:38 +0100
parents e9cd473a2f46
children d715d912afac
files sat/core/sat_main.py sat/core/xmpp.py
diffstat 2 files changed, 17 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/sat/core/sat_main.py	Sat Nov 10 10:16:35 2018 +0100
+++ b/sat/core/sat_main.py	Sat Nov 10 10:16:38 2018 +0100
@@ -63,10 +63,12 @@
         self.initialised = defer.Deferred()
         self.profiles = {}
         self.plugins = {}
+        # map for short name to whole namespace,
         self.ns_map = {
-            u"x-data": u"jabber:x:data"
-        }  #  map for short name to whole namespace,
-        #  extended by plugins with registerNamespace
+            u"x-data": xmpp.NS_X_DATA,
+            u"disco#info": xmpp.NS_DISCO_INFO,
+        }
+        # extended by plugins with registerNamespace
         self.memory = memory.Memory(self)
         self.trigger = (
             trigger.TriggerManager()
--- a/sat/core/xmpp.py	Sat Nov 10 10:16:35 2018 +0100
+++ b/sat/core/xmpp.py	Sat Nov 10 10:16:38 2018 +0100
@@ -43,6 +43,10 @@
 import sys
 
 
+NS_X_DATA = u"jabber:x:data"
+NS_DISCO_INFO = u"http://jabber.org/protocol/disco#info"
+
+
 class SatXMPPEntity(object):
     """Common code for Client and Component"""
     _reason = None  # reason of disconnection
@@ -1351,9 +1355,17 @@
 
 
 class SatDiscoProtocol(disco.DiscoClientProtocol):
+    implements(iwokkel.IDisco)
+
     def __init__(self, host):
         disco.DiscoClientProtocol.__init__(self)
 
+    def getDiscoInfo(self, requestor, target, nodeIdentifier=""):
+        return [disco.DiscoFeature(NS_DISCO_INFO)]
+
+    def getDiscoItems(self, requestor, target, nodeIdentifier=""):
+        return []
+
 
 class SatFallbackHandler(generic.FallbackHandler):
     def __init__(self, host):