diff sat_pubsub/backend.py @ 357:1167e48e5f52

handle single node on subscriptions request
author Goffi <goffi@goffi.org>
date Fri, 08 Sep 2017 08:02:05 +0200
parents c72fcbdcdab7
children 9e40fc16f4df
line wrap: on
line diff
--- a/sat_pubsub/backend.py	Fri Sep 08 08:02:05 2017 +0200
+++ b/sat_pubsub/backend.py	Fri Sep 08 08:02:05 2017 +0200
@@ -530,8 +530,14 @@
         d.addCallback(lambda node: node.removeSubscription(subscriber))
         return d
 
-    def getSubscriptions(self, requestor, pep, recipient):
-        return self.storage.getSubscriptions(requestor, pep, recipient)
+    def getSubscriptions(self, requestor, nodeIdentifier, pep, recipient):
+        """retrieve subscriptions of an entity
+
+        @param requestor(jid.JID): entity who want to check subscriptions
+        @param nodeIdentifier(unicode, None): identifier of the node
+            node to get all subscriptions of a service
+        """
+        return self.storage.getSubscriptions(requestor, nodeIdentifier, pep, recipient)
 
     def supportsAutoCreate(self):
         return True
@@ -616,7 +622,7 @@
     def setNodeSchema(self, nodeIdentifier, schema, requestor, pep, recipient):
         """set or remove Schema of a node
 
-        @param NodeIdentifier(unicode): identifier of the pubusb node
+        @param nodeIdentifier(unicode): identifier of the pubusb node
         @param schema(domish.Element, None): schema to set
             None to remove schema
         """
@@ -1556,6 +1562,7 @@
 
     def subscriptions(self, request):
         d = self.backend.getSubscriptions(request.sender,
+                                          request.nodeIdentifier,
                                           self._isPep(request),
                                           request.recipient)
         return d.addErrback(self._mapErrors)