# HG changeset patch # User Goffi # Date 1297119713 -3600 # Node ID f7bd973bba5abaf7ce6157abfed7a6cc32771825 # Parent 7c79d4a8c9e622db8ae70d1081f9fb8cd67ec90b 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 diff -r 7c79d4a8c9e6 -r f7bd973bba5a src/sat.tac --- a/src/sat.tac Sun Feb 06 23:49:27 2011 +0100 +++ b/src/sat.tac Tue Feb 08 00:01:53 2011 +0100 @@ -261,7 +261,9 @@ generic.FallbackHandler.__init__(self) def iqFallback(self, iq): - debug (u"iqFallback: xml = [%s], handled=%s" % (iq.toXml(), "True" if iq.handled else "False")) + if iq.handled == True: + return + debug (u"iqFallback: xml = [%s]" % (iq.toXml())) generic.FallbackHandler.iqFallback(self, iq) class RegisteringAuthenticator(xmlstream.ConnectAuthenticator): @@ -309,7 +311,16 @@ answer_data={"message":_("Registration failed (%s)") % str(failure.value.condition)} self.host.bridge.actionResult(answer_type, self.answer_id, answer_data) self.xmlstream.sendFooter() - + +class SatVersionHandler(generic.VersionHandler): + + def getDiscoInfo(self, requestor, target, node): + #XXX: We need to work around wokkel's behavious (namespace not added if there is a + # node) as it cause issues with XEP-0115 & PEP (XEP-0163): there is a node when server + # ask for disco info, and not when we generate the key, so the hash is used with different + # disco features, and when the server (seen on ejabberd) generate its own hash for security check + # it reject our features (resulting in e.g. no notification on PEP) + return generic.VersionHandler.getDiscoInfo(self, requestor, target, None) class SAT(service.Service): @@ -453,7 +464,7 @@ current.fallBack = SatFallbackHandler(self) current.fallBack.setHandlerParent(current) - current.versionHandler = generic.VersionHandler(self.get_const('client_name'), + current.versionHandler = SatVersionHandler(self.get_const('client_name'), self.get_const('client_version')) current.versionHandler.setHandlerParent(current)