comparison src/plugins/plugin_xep_0277.py @ 2305:972e33507609

plugin XEP-0060: addManagedNode callbacks now use client syntax instead of profile
author Goffi <goffi@goffi.org>
date Wed, 05 Jul 2017 15:04:43 +0200
parents f8276bd8baf6
children 310a454c8657
comparison
equal deleted inserted replaced
2304:666ad9de044c 2305:972e33507609
110 d.addCallbacks(self._checkFeaturesCb, self._checkFeaturesEb) 110 d.addCallbacks(self._checkFeaturesCb, self._checkFeaturesEb)
111 return d 111 return d
112 112
113 ## plugin management methods ## 113 ## plugin management methods ##
114 114
115 def _itemsReceived(self, itemsEvent, profile): 115 def _itemsReceived(self, client, itemsEvent):
116 """Callback which manage items notifications (publish + retract)""" 116 """Callback which manage items notifications (publish + retract)"""
117 def manageItem(data, event): 117 def manageItem(data, event):
118 self.host.bridge.psEvent(C.PS_MICROBLOG, itemsEvent.sender.full(), itemsEvent.nodeIdentifier, event, data, profile) 118 self.host.bridge.psEvent(C.PS_MICROBLOG, itemsEvent.sender.full(), itemsEvent.nodeIdentifier, event, data, client.profile)
119 119
120 for item in itemsEvent.items: 120 for item in itemsEvent.items:
121 if item.name == C.PS_ITEM: 121 if item.name == C.PS_ITEM:
122 self.item2mbdata(item).addCallbacks(manageItem, lambda failure: None, (C.PS_PUBLISH,)) 122 self.item2mbdata(item).addCallbacks(manageItem, lambda failure: None, (C.PS_PUBLISH,))
123 elif item.name == C.PS_RETRACT: 123 elif item.name == C.PS_RETRACT: