From 223dc0a8f296ab95c8399a887d93eb8f1bc158a6 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sun, 2 Nov 2008 15:02:49 +0000 Subject: [PATCH] don't count echo as a file transfer proxy. Fixes #4411 --- src/common/connection_handlers.py | 40 +++++++++++++++++-------------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index 2ef8342bf..1aa57e95d 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -758,26 +758,30 @@ class ConnectionDisco: if self.commandInfoQuery(con, iq_obj): raise common.xmpp.NodeProcessed - else: - iq = iq_obj.buildReply('result') - q = iq.getTag('query') - if node: - q.setAttr('node', node) - q.addChild('identity', attrs = gajim.gajim_identity) - extension = None - if node and node.find('#') != -1: - extension = node[node.index('#') + 1:] - client_version = 'http://gajim.org#' + gajim.caps_hash[self.name] + id = unicode(iq_obj.getAttr('id')) + if id[0] == 'p': + # We get this request from echo.server + raise common.xmpp.NodeProcessed - if node in (None, client_version): - for f in gajim.gajim_common_features: - q.addChild('feature', attrs = {'var': f}) - for f in gajim.gajim_optional_features[self.name]: - q.addChild('feature', attrs = {'var': f}) + iq = iq_obj.buildReply('result') + q = iq.getTag('query') + if node: + q.setAttr('node', node) + q.addChild('identity', attrs = gajim.gajim_identity) + extension = None + if node and node.find('#') != -1: + extension = node[node.index('#') + 1:] + client_version = 'http://gajim.org#' + gajim.caps_hash[self.name] - if q.getChildren(): - self.connection.send(iq) - raise common.xmpp.NodeProcessed + if node in (None, client_version): + for f in gajim.gajim_common_features: + q.addChild('feature', attrs = {'var': f}) + for f in gajim.gajim_optional_features[self.name]: + q.addChild('feature', attrs = {'var': f}) + + if q.getChildren(): + self.connection.send(iq) + raise common.xmpp.NodeProcessed def _DiscoverInfoErrorCB(self, con, iq_obj): gajim.log.debug('DiscoverInfoErrorCB')