comparison wokkel/pubsub.py @ 17:fd6957dfa8c6 0.6.0

tmp (wokkel.pubsub): implemented missing notifyRetract
author Goffi <goffi@goffi.org>
date Wed, 25 Nov 2015 15:35:21 +0100
parents 1de25b1f609f
children 54f834e40341
comparison
equal deleted inserted replaced
16:4629645a368d 17:fd6957dfa8c6
1467 item.uri = NS_PUBSUB_EVENT 1467 item.uri = NS_PUBSUB_EVENT
1468 message.event.items.addChild(item) 1468 message.event.items.addChild(item)
1469 self.send(message) 1469 self.send(message)
1470 1470
1471 1471
1472 def notifyRetract(self, service, nodeIdentifier, notifications):
1473 for subscriber, subscriptions, items in notifications:
1474 message = self._createNotification('items', service,
1475 nodeIdentifier, subscriber,
1476 subscriptions)
1477 for item in items:
1478 retract = domish.Element((None, "retract"))
1479 retract['id'] = item['id']
1480 message.event.items.addChild(retract)
1481 self.send(message)
1482
1483
1472 def notifyDelete(self, service, nodeIdentifier, subscribers, 1484 def notifyDelete(self, service, nodeIdentifier, subscribers,
1473 redirectURI=None): 1485 redirectURI=None):
1474 for subscriber in subscribers: 1486 for subscriber in subscribers:
1475 message = self._createNotification('delete', service, 1487 message = self._createNotification('delete', service,
1476 nodeIdentifier, 1488 nodeIdentifier,