comparison src/plugins/plugin_xep_0115.py @ 2148:a543eda2c923

core (memory/disco): getInfos now handle node + use client instead of profile in many methods
author Goffi <goffi@goffi.org>
date Sun, 12 Feb 2017 20:43:20 +0100
parents 33c8c4973743
children 8b37a62336c3
comparison
equal deleted inserted replaced
2147:bca699faf416 2148:a543eda2c923
64 def _checkHash(self, disco_d, profile): 64 def _checkHash(self, disco_d, profile):
65 client = self.host.getClient(profile) 65 client = self.host.getClient(profile)
66 client.caps_optimize = None 66 client.caps_optimize = None
67 67
68 if XEP_0115.cap_hash is None: 68 if XEP_0115.cap_hash is None:
69 disco_d.addCallback(lambda dummy: self.host.hasFeature(NS_CAPS_OPTIMIZE, profile=profile)) 69 disco_d.addCallback(lambda dummy: self.host.hasFeature(client, NS_CAPS_OPTIMIZE))
70 def updateOptimize(optimize): 70 def updateOptimize(optimize):
71 client.caps_optimize = optimize 71 client.caps_optimize = optimize
72 if optimize: 72 if optimize:
73 log.info(_("Caps optimisation enabled")) 73 log.info(_("Caps optimisation enabled"))
74 client.caps_sent = False 74 client.caps_sent = False
161 if isinstance(failure.value, error.ConnectionDone): 161 if isinstance(failure.value, error.ConnectionDone):
162 return 162 return
163 msg = failure.value.condition if hasattr(failure.value, 'condition') else failure.getErrorMessage() 163 msg = failure.value.condition if hasattr(failure.value, 'condition') else failure.getErrorMessage()
164 log.error(_(u"Couldn't retrieve disco info for {jid}: {error}").format(jid=from_jid.full(), error=msg)) 164 log.error(_(u"Couldn't retrieve disco info for {jid}: {error}").format(jid=from_jid.full(), error=msg))
165 165
166 d = self.host.getDiscoInfos(from_jid, self.profile) 166 d = self.host.getDiscoInfos(self.parent, from_jid)
167 d.addCallbacks(cb, eb) 167 d.addCallbacks(cb, eb)
168 # TODO: me must manage the full algorithm described at XEP-0115 #5.4 part 3 168 # TODO: me must manage the full algorithm described at XEP-0115 #5.4 part 3