comparison src/plugins/plugin_xep_0055.py @ 1219:16484ebb695b

plugin XEP-0059: first draft, pubsub and jabber search do not exploit it yet
author souliane <souliane@mailoo.org>
date Mon, 22 Sep 2014 22:25:44 +0200
parents 301b342c697a
children 069ad98b360d
comparison
equal deleted inserted replaced
1218:3b1c5f723c4b 1219:16484ebb695b
33 PLUGIN_INFO = { 33 PLUGIN_INFO = {
34 "name": "Jabber Search", 34 "name": "Jabber Search",
35 "import_name": "XEP-0055", 35 "import_name": "XEP-0055",
36 "type": "XEP", 36 "type": "XEP",
37 "protocols": ["XEP-0055"], 37 "protocols": ["XEP-0055"],
38 "dependencies": [],
39 "recommendations": ["XEP-0059"],
38 "main": "XEP_0055", 40 "main": "XEP_0055",
39 "handler": "no", 41 "handler": "no",
40 "description": _("""Implementation of Jabber Search""") 42 "description": _("""Implementation of Jabber Search""")
41 } 43 }
42 44
154 search_request["to"] = to_jid.full() 156 search_request["to"] = to_jid.full()
155 query_elt = search_request.addElement('query', NS_SEARCH) 157 query_elt = search_request.addElement('query', NS_SEARCH)
156 x_form = data_form.Form('submit', formNamespace = NS_SEARCH) 158 x_form = data_form.Form('submit', formNamespace = NS_SEARCH)
157 x_form.makeFields(search_dict) 159 x_form.makeFields(search_dict)
158 query_elt.addChild(x_form.toElement()) 160 query_elt.addChild(x_form.toElement())
161 # TODO: XEP-0059 could be used here (with the needed new method attributes)
159 d = search_request.send(to_jid.full()) 162 d = search_request.send(to_jid.full())
160 d.addCallbacks(self._searchOk, self._searchErr, callbackArgs=[client.profile], errbackArgs=[client.profile]) 163 d.addCallbacks(self._searchOk, self._searchErr, callbackArgs=[client.profile], errbackArgs=[client.profile])
161 return d 164 return d
162 165
163 def _searchOk(self, answer, profile): 166 def _searchOk(self, answer, profile):