From 94eaf21945ee07265c3eaef57ea8665f5b32a9bb Mon Sep 17 00:00:00 2001 From: Goffi Date: Tue, 25 Aug 2015 20:02:50 +0200 Subject: [PATCH] plugin XEP-0050: return disco for commands only on commands namespace --- src/plugins/plugin_xep_0050.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/plugin_xep_0050.py b/src/plugins/plugin_xep_0050.py index 0829ed2c..f82a4125 100644 --- a/src/plugins/plugin_xep_0050.py +++ b/src/plugins/plugin_xep_0050.py @@ -113,6 +113,8 @@ class AdHocCommand(XMPPHandler): return False def getDiscoInfo(self, requestor, target, nodeIdentifier=''): + if nodeIdentifier != NS_COMMANDS: # FIXME: we should manage other disco nodes here + return [] # identities = [ID_CMD_LIST if self.node == NS_COMMANDS else ID_CMD_NODE] # FIXME return [disco.DiscoFeature(NS_COMMANDS)] + self.features @@ -460,13 +462,13 @@ class XEP_0050(object): d.addCallback(self._items2XMLUI) return d - def addAdHocCommand(self, callback, label, node="", features = None, timeout = 600, allowed_jids = None, allowed_groups = None, + def addAdHocCommand(self, callback, label, node=None, features = None, timeout = 600, allowed_jids = None, allowed_groups = None, allowed_magics = None, forbidden_jids = None, forbidden_groups = None, profile_key=C.PROF_KEY_NONE): """Add an ad-hoc command for the current profile @param callback: method associated with this ad-hoc command which return the payload data (see AdHocCommand._sendAnswer), can return a deferred @param label: label associated with this command on the main menu - @param node: disco item node associated with this command. None or "" to use autogenerated node + @param node: disco item node associated with this command. None to use autogenerated node @param features: features associated with the payload (list of strings), usualy data form @param timeout: delay between two requests before canceling the session (in seconds) @param allowed_jids: list of allowed entities