comparison src/plugins/plugin_xep_0115.py @ 957:2eb4fef29795

plulgin XEP-0115: fixed caps_optimize init
author Goffi <goffi@goffi.org>
date Mon, 31 Mar 2014 16:57:02 +0200
parents 4a577b170809
children b280cf4cdf25
comparison
equal deleted inserted replaced
956:132de9d487ac 957:2eb4fef29795
59 59
60 def getHandler(self, profile): 60 def getHandler(self, profile):
61 return XEP_0115_handler(self, profile) 61 return XEP_0115_handler(self, profile)
62 62
63 def _checkHash(self, disco_d, profile): 63 def _checkHash(self, disco_d, profile):
64 client = self.host.getClient(profile)
65 client.caps_optimize = None
66
64 if XEP_0115.cap_hash is None: 67 if XEP_0115.cap_hash is None:
65 disco_d.addCallback(lambda dummy: self.host.hasFeature(NS_CAPS_OPTIMIZE, profile_key=profile)) 68 disco_d.addCallback(lambda dummy: self.host.hasFeature(NS_CAPS_OPTIMIZE, profile_key=profile))
66 def updateOptimize(optimize): 69 def updateOptimize(optimize):
67 client = self.host.getClient(profile)
68 client.caps_optimize = optimize 70 client.caps_optimize = optimize
69 if optimize: 71 if optimize:
70 info(_("Caps optimisation enabled")) 72 info(_("Caps optimisation enabled"))
71 client.caps_sent = False 73 client.caps_sent = False
72 else: 74 else: