comparison src/plugins/plugin_exp_events.py @ 2272:b5befe7722d3

plugin XEP-0060: added sendItem and psItemSend bridge method as a way to send directly raw XML for an item + use client instead of profile_key in publish + renamed psItemGet to psItemsGet
author Goffi <goffi@goffi.org>
date Tue, 27 Jun 2017 19:38:20 +0200
parents e8641b7718dc
children ea869f30f204
comparison
equal deleted inserted replaced
2271:2fae89f30b8d 2272:b5befe7722d3
234 node = yield self._p.createNode(client, service, nodeIdentifier=node) 234 node = yield self._p.createNode(client, service, nodeIdentifier=node)
235 except error.StanzaError as e: 235 except error.StanzaError as e:
236 if e.condition == u'conflict': 236 if e.condition == u'conflict':
237 log.debug(_(u"requested node already exists")) 237 log.debug(_(u"requested node already exists"))
238 238
239 yield self._p.publish(service, node, items=[item_elt], profile_key=client.profile) 239 yield self._p.publish(client, service, node, items=[item_elt])
240 240
241 defer.returnValue(node) 241 defer.returnValue(node)
242 242
243 def _eventModify(self, service, node, id_, timestamp_update, data_update, profile_key=C.PROF_KEY_NONE): 243 def _eventModify(self, service, node, id_, timestamp_update, data_update, profile_key=C.PROF_KEY_NONE):
244 service = jid.JID(service) if service else None 244 service = jid.JID(service) if service else None
311 try: 311 try:
312 event_elt[key] = data.pop(key) 312 event_elt[key] = data.pop(key)
313 except KeyError: 313 except KeyError:
314 pass 314 pass
315 item_elt = pubsub.Item(id=client.jid.userhost(), payload=event_elt) 315 item_elt = pubsub.Item(id=client.jid.userhost(), payload=event_elt)
316 return self._p.publish(service, node, items=[item_elt], profile_key=client.profile) 316 return self._p.publish(client, service, node, items=[item_elt])