mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-27 19:19:54 +00:00
Fix a few holes in caps.
Protip: Don't test using a custom disco handler that always returns the same feature set :p
This commit is contained in:
parent
fa912aeb84
commit
35954cdc90
1 changed files with 15 additions and 6 deletions
|
@ -245,14 +245,23 @@ class xep_0115(base_plugin):
|
||||||
return base64.b64encode(binary)
|
return base64.b64encode(binary)
|
||||||
|
|
||||||
def update_caps(self, jid=None, node=None):
|
def update_caps(self, jid=None, node=None):
|
||||||
info = self.disco.get_info(jid, node, local=True)
|
try:
|
||||||
if isinstance(info, Iq):
|
info = self.disco.get_info(jid, node, local=True)
|
||||||
info = info['disco_info']
|
if isinstance(info, Iq):
|
||||||
ver = self.generate_verstring(info, self.hash)
|
info = info['disco_info']
|
||||||
self.cache_caps(ver, info)
|
ver = self.generate_verstring(info, self.hash)
|
||||||
self.assign_verstring(jid, ver)
|
self.disco.set_info(
|
||||||
|
jid=jid,
|
||||||
|
node='%s#%s' % (self.caps_node, ver),
|
||||||
|
info=info)
|
||||||
|
self.cache_caps(ver, info)
|
||||||
|
self.assign_verstring(jid, ver)
|
||||||
|
except XMPPError:
|
||||||
|
return
|
||||||
|
|
||||||
def get_verstring(self, jid=None):
|
def get_verstring(self, jid=None):
|
||||||
|
if jid in ('', None):
|
||||||
|
jid = self.xmpp.boundjid.full
|
||||||
return self._run_node_handler('get_verstring', jid)
|
return self._run_node_handler('get_verstring', jid)
|
||||||
|
|
||||||
def assign_verstring(self, jid=None, verstring=None):
|
def assign_verstring(self, jid=None, verstring=None):
|
||||||
|
|
Loading…
Reference in a new issue