From 128cc2eeb4b7f526d2af87d09129a1838061bb1e Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 31 Mar 2018 00:25:28 +0200 Subject: XEP-0115: Use the new cache system. --- slixmpp/plugins/xep_0115/static.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'slixmpp/plugins/xep_0115/static.py') diff --git a/slixmpp/plugins/xep_0115/static.py b/slixmpp/plugins/xep_0115/static.py index d47c8fd8..6c2e910b 100644 --- a/slixmpp/plugins/xep_0115/static.py +++ b/slixmpp/plugins/xep_0115/static.py @@ -33,7 +33,6 @@ class StaticCaps(object): self.disco = self.xmpp['xep_0030'] self.caps = self.xmpp['xep_0115'] self.static = static - self.ver_cache = {} self.jid_vers = {} def supports(self, jid, node, ifrom, data): @@ -128,7 +127,7 @@ class StaticCaps(object): info = data.get('info', None) if not verstring or not info: return - self.ver_cache[verstring] = info + self.caps.cache.store(verstring, info) def assign_verstring(self, jid, node, ifrom, data): if isinstance(jid, JID): @@ -139,4 +138,7 @@ class StaticCaps(object): return self.jid_vers.get(jid, None) def get_caps(self, jid, node, ifrom, data): - return self.ver_cache.get(data.get('verstring', None), None) + verstring = data.get('verstring', None) + if verstring is None: + return None + return self.caps.cache.retrieve(verstring) -- cgit v1.2.3