comparison src/sat.tac @ 292:f7bd973bba5a

core: wokkel behavious work around on VersionHandler to avoid XEP-0115 issue with ejabberd (see comments for details) iq fallback trace not shown anymore when iq is actually handled
author Goffi <goffi@goffi.org>
date Tue, 08 Feb 2011 00:01:53 +0100
parents 76247af9917c
children 15a12bf2bb62
comparison
equal deleted inserted replaced
291:7c79d4a8c9e6 292:f7bd973bba5a
259 class SatFallbackHandler(generic.FallbackHandler): 259 class SatFallbackHandler(generic.FallbackHandler):
260 def __init__(self, host): 260 def __init__(self, host):
261 generic.FallbackHandler.__init__(self) 261 generic.FallbackHandler.__init__(self)
262 262
263 def iqFallback(self, iq): 263 def iqFallback(self, iq):
264 debug (u"iqFallback: xml = [%s], handled=%s" % (iq.toXml(), "True" if iq.handled else "False")) 264 if iq.handled == True:
265 return
266 debug (u"iqFallback: xml = [%s]" % (iq.toXml()))
265 generic.FallbackHandler.iqFallback(self, iq) 267 generic.FallbackHandler.iqFallback(self, iq)
266 268
267 class RegisteringAuthenticator(xmlstream.ConnectAuthenticator): 269 class RegisteringAuthenticator(xmlstream.ConnectAuthenticator):
268 270
269 def __init__(self, host, jabber_host, user_login, user_pass, answer_id): 271 def __init__(self, host, jabber_host, user_login, user_pass, answer_id):
307 else: 309 else:
308 answer_data['reason'] = 'unknown' 310 answer_data['reason'] = 'unknown'
309 answer_data={"message":_("Registration failed (%s)") % str(failure.value.condition)} 311 answer_data={"message":_("Registration failed (%s)") % str(failure.value.condition)}
310 self.host.bridge.actionResult(answer_type, self.answer_id, answer_data) 312 self.host.bridge.actionResult(answer_type, self.answer_id, answer_data)
311 self.xmlstream.sendFooter() 313 self.xmlstream.sendFooter()
312 314
315 class SatVersionHandler(generic.VersionHandler):
316
317 def getDiscoInfo(self, requestor, target, node):
318 #XXX: We need to work around wokkel's behavious (namespace not added if there is a
319 # node) as it cause issues with XEP-0115 & PEP (XEP-0163): there is a node when server
320 # ask for disco info, and not when we generate the key, so the hash is used with different
321 # disco features, and when the server (seen on ejabberd) generate its own hash for security check
322 # it reject our features (resulting in e.g. no notification on PEP)
323 return generic.VersionHandler.getDiscoInfo(self, requestor, target, None)
313 324
314 class SAT(service.Service): 325 class SAT(service.Service):
315 326
316 def get_next_id(self): 327 def get_next_id(self):
317 return sat_next_id() 328 return sat_next_id()
451 current.presence.setHandlerParent(current) 462 current.presence.setHandlerParent(current)
452 463
453 current.fallBack = SatFallbackHandler(self) 464 current.fallBack = SatFallbackHandler(self)
454 current.fallBack.setHandlerParent(current) 465 current.fallBack.setHandlerParent(current)
455 466
456 current.versionHandler = generic.VersionHandler(self.get_const('client_name'), 467 current.versionHandler = SatVersionHandler(self.get_const('client_name'),
457 self.get_const('client_version')) 468 self.get_const('client_version'))
458 current.versionHandler.setHandlerParent(current) 469 current.versionHandler.setHandlerParent(current)
459 470
460 debug (_("setting plugins parents")) 471 debug (_("setting plugins parents"))
461 472