summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-03-31 00:44:53 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-03-31 00:44:53 +0200
commit32839f52524bec848893204a4f58337a820e6faf (patch)
treeabe4161ff796b094678931272063b482799b0bad
parent80b7cf6ff8efbe653f5e6c4b4d4d43dd4b388c6e (diff)
downloadslixmpp-32839f52524bec848893204a4f58337a820e6faf.tar.gz
slixmpp-32839f52524bec848893204a4f58337a820e6faf.tar.bz2
slixmpp-32839f52524bec848893204a4f58337a820e6faf.tar.xz
slixmpp-32839f52524bec848893204a4f58337a820e6faf.zip
util.cache: Let the user select the bare JID or not.
-rw-r--r--slixmpp/util/cache.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/slixmpp/util/cache.py b/slixmpp/util/cache.py
index 79498d5e..2a117eb4 100644
--- a/slixmpp/util/cache.py
+++ b/slixmpp/util/cache.py
@@ -41,13 +41,13 @@ class MemoryPerJidCache(PerJidCache):
self.cache = {}
def retrieve_by_jid(self, jid, key):
- cache = self.cache.get(jid.bare, None)
+ cache = self.cache.get(jid, None)
if cache is None:
return None
return cache.get(key, None)
def store_by_jid(self, jid, key, value):
- cache = self.cache.setdefault(jid.bare, {})
+ cache = self.cache.setdefault(jid, {})
cache[key] = value
return True
@@ -97,9 +97,9 @@ class FileSystemPerJidCache(PerJidCache, FileSystemStorage):
self.base_dir = os.path.join(directory, cache_type)
def retrieve_by_jid(self, jid, key):
- directory = os.path.join(self.base_dir, jid.bare)
+ directory = os.path.join(self.base_dir, jid)
return self._retrieve(directory, key)
def store_by_jid(self, jid, key, value):
- directory = os.path.join(self.base_dir, jid.bare)
+ directory = os.path.join(self.base_dir, jid)
return self._store(directory, key, value)