diff idavoll/memory_storage.py @ 148:b03e5ad81173

Change all calls to jid.JID to jid.internJID to avoid redoing stringprep.
author Ralph Meijer <ralphm@ik.nu>
date Wed, 31 Aug 2005 12:58:50 +0000
parents b4490bdc77e5
children 5191ba7c4df8
line wrap: on
line diff
--- a/idavoll/memory_storage.py	Fri Jul 29 15:38:29 2005 +0000
+++ b/idavoll/memory_storage.py	Wed Aug 31 12:58:50 2005 +0000
@@ -58,7 +58,7 @@
         subscriptions = []
         for node in self._nodes.itervalues():
             for subscriber, subscription in node._subscriptions.iteritems():
-                subscriber = jid.JID(subscriber)
+                subscriber = jid.internJID(subscriber)
                 if subscriber.userhostJID() == entity.userhostJID():
                     subscriptions.append((node.id, subscriber,
                                           subscription.state))
@@ -122,7 +122,7 @@
         return defer.succeed(None)
 
     def get_subscribers(self):
-        subscribers = [jid.JID(subscriber) for subscriber, subscription
+        subscribers = [jid.internJID(subscriber) for subscriber, subscription
                        in self._subscriptions.iteritems()
                        if subscription.state == 'subscribed']
 
@@ -130,14 +130,14 @@
 
     def is_subscribed(self, entity):
         for subscriber, subscription in self._subscriptions.iteritems():
-            if jid.JID(subscriber).userhost() == entity.userhost() and \
+            if jid.internJID(subscriber).userhost() == entity.userhost() and \
                     subscription.state == 'subscribed':
                 return defer.succeed(True)
         
         return defer.succeed(False)
 
     def get_affiliations(self):
-        affiliations = [(jid.JID(entity), affiliation) for entity, affiliation
+        affiliations = [(jid.internJID(entity), affiliation) for entity, affiliation
                        in self._affiliations.iteritems()]
 
         return defer.succeed(affiliations)