changeset 174:79d451d186b1

Send out node deletion notifications.
author Ralph Meijer <ralphm@ik.nu>
date Wed, 09 Apr 2008 11:48:38 +0000
parents 246911bcb699
children bd86f0c3fd39
files idavoll/backend.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/idavoll/backend.py	Wed Apr 09 11:43:16 2008 +0000
+++ b/idavoll/backend.py	Wed Apr 09 11:48:38 2008 +0000
@@ -385,6 +385,7 @@
         self.pubSubFeatures = self._getPubSubFeatures()
 
         self.backend.register_notifier(self._notify)
+        self.backend.register_pre_delete(self._pre_delete)
 
     def _getPubSubFeatures(self):
         features = [
@@ -426,6 +427,13 @@
                                                                nodeIdentifier,
                                                                notifications))
 
+    def _pre_delete(self, nodeIdentifier):
+        d = self.backend.get_subscribers(nodeIdentifier)
+        d.addCallback(lambda subscribers: self.notifyDelete(self.serviceJID,
+                                                            nodeIdentifier,
+                                                            subscribers))
+        return d
+
     def _mapErrors(self, failure):
         e = failure.trap(*self._errorMap.keys())