comparison src/plugins/plugin_xep_0059.py @ 1465:cbf38047ca60

plugin XEP-0059: fixed bad disco handling
author Goffi <goffi@goffi.org>
date Tue, 18 Aug 2015 09:01:18 +0200
parents 069ad98b360d
children d17772b0fe22
comparison
equal deleted inserted replaced
1464:fecd502743b3 1465:cbf38047ca60
36 "name": "Result Set Management", 36 "name": "Result Set Management",
37 "import_name": "XEP-0059", 37 "import_name": "XEP-0059",
38 "type": "XEP", 38 "type": "XEP",
39 "protocols": ["XEP-0059"], 39 "protocols": ["XEP-0059"],
40 "main": "XEP_0059", 40 "main": "XEP_0059",
41 "handler": "no", 41 "handler": "yes",
42 "description": _("""Implementation of Result Set Management""") 42 "description": _("""Implementation of Result Set Management""")
43 } 43 }
44 44
45 45
46 class XEP_0059(object): 46 class XEP_0059(object):
47 # XXX: RSM management is done directly in Wokkel. 47 # XXX: RSM management is done directly in Wokkel.
48 48
49 def __init__(self, host): 49 def __init__(self, host):
50 log.info(_("Result Set Management plugin initialization")) 50 log.info(_("Result Set Management plugin initialization"))
51 51
52 def getHandler(self, profile):
53 return XEP_0059_handler()
54
52 55
53 class XEP_0059_handler(XMPPHandler): 56 class XEP_0059_handler(XMPPHandler):
54 implements(iwokkel.IDisco) 57 implements(iwokkel.IDisco)
55
56 def __init__(self, plugin_parent, profile):
57 self.plugin_parent = plugin_parent
58 self.host = plugin_parent.host
59 self.profile = profile
60 58
61 def getDiscoInfo(self, requestor, target, nodeIdentifier=''): 59 def getDiscoInfo(self, requestor, target, nodeIdentifier=''):
62 return [disco.DiscoFeature(NS_RSM)] 60 return [disco.DiscoFeature(NS_RSM)]
63 61
64 def getDiscoItems(self, requestor, target, nodeIdentifier=''): 62 def getDiscoItems(self, requestor, target, nodeIdentifier=''):