changeset 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 4629645a368d
children ba8ce62bfab0
files wokkel/pubsub.py
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/wokkel/pubsub.py	Thu Sep 10 15:04:16 2015 +0200
+++ b/wokkel/pubsub.py	Wed Nov 25 15:35:21 2015 +0100
@@ -1469,6 +1469,18 @@
             self.send(message)
 
 
+    def notifyRetract(self, service, nodeIdentifier, notifications):
+        for subscriber, subscriptions, items in notifications:
+            message = self._createNotification('items', service,
+                                               nodeIdentifier, subscriber,
+                                               subscriptions)
+            for item in items:
+                retract = domish.Element((None, "retract"))
+                retract['id'] = item['id']
+                message.event.items.addChild(retract)
+            self.send(message)
+
+
     def notifyDelete(self, service, nodeIdentifier, subscribers,
                            redirectURI=None):
         for subscriber in subscribers: