diff idavoll/backend.py @ 216:53d2c0019458

Fix subscription and unsubscription JID checks.
author Ralph Meijer <ralphm@ik.nu>
date Thu, 03 Sep 2009 16:27:32 +0000
parents bfc198af5d27
children 698af5d720ad
line wrap: on
line diff
--- a/idavoll/backend.py	Thu Jun 18 13:11:59 2009 +0000
+++ b/idavoll/backend.py	Thu Sep 03 16:27:32 2009 +0000
@@ -222,7 +222,7 @@
 
     def subscribe(self, nodeIdentifier, subscriber, requestor):
         subscriberEntity = subscriber.userhostJID()
-        if subscriberEntity != requestor:
+        if subscriberEntity != requestor.userhostJID():
             return defer.fail(error.Forbidden())
 
         d = self.storage.getNode(nodeIdentifier)
@@ -276,7 +276,7 @@
 
 
     def unsubscribe(self, nodeIdentifier, subscriber, requestor):
-        if subscriber.userhostJID() != requestor:
+        if subscriber.userhostJID() != requestor.userhostJID():
             return defer.fail(error.Forbidden())
 
         d = self.storage.getNode(nodeIdentifier)