# HG changeset patch # User Goffi # Date 1440525770 -7200 # Node ID 74ddb4cc2ff9eb36d5f4193684badc0c9d6f0519 # Parent 1285c714a6cce9e51ea0bd761bf5f04163cf923a plugin XEP-0050: return disco for commands only on commands namespace diff -r 1285c714a6cc -r 74ddb4cc2ff9 src/plugins/plugin_xep_0050.py --- a/src/plugins/plugin_xep_0050.py Tue Aug 25 16:52:18 2015 +0200 +++ b/src/plugins/plugin_xep_0050.py Tue Aug 25 20:02:50 2015 +0200 @@ -113,6 +113,8 @@ 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 @@ 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