comparison sat_pubsub/privilege.py @ 342:28c9579901d3

privilege: fixed addition of owner to publishers in onPresence
author Goffi <goffi@goffi.org>
date Sun, 20 Aug 2017 12:35:04 +0200
parents 6d059f07c2d3
children ff8aff4c9b79
comparison
equal deleted inserted replaced
341:b49f75a26156 342:28c9579901d3
251 # nodes are the nodes subscribed with +notify 251 # nodes are the nodes subscribed with +notify
252 nodes = tuple(self.hash_map[disco_tuple]['notify']) 252 nodes = tuple(self.hash_map[disco_tuple]['notify'])
253 if not nodes: 253 if not nodes:
254 return 254 return
255 # publishers are entities which have granted presence access to our user + user itself 255 # publishers are entities which have granted presence access to our user + user itself
256 publishers = self.presence_map.get(from_jid_bare, ()) + (from_jid_bare,) 256 publishers = tuple(self.presence_map.get(from_jid_bare, ())) + (from_jid_bare,)
257 257
258 last_items = yield self._backend.storage.getLastItems(publishers, nodes, ('open',), ('open',), True) 258 last_items = yield self._backend.storage.getLastItems(publishers, nodes, ('open',), ('open',), True)
259 # we send message with last item, as required by https://xmpp.org/extensions/xep-0163.html#notify-last 259 # we send message with last item, as required by https://xmpp.org/extensions/xep-0163.html#notify-last
260 for pep_jid, node, item, item_access_model in last_items: 260 for pep_jid, node, item, item_access_model in last_items:
261 self.notifyPublish(pep_jid, node, [(from_jid, None, [item])]) 261 self.notifyPublish(pep_jid, node, [(from_jid, None, [item])])