From 0f66868a70831df491ddce915decd0a15b793855 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 9 May 2005 10:34:47 +0000 Subject: [PATCH] revert latest commit I did (sorry) --- src/common/connection.py | 46 ++++++++++++++++++++-------------------- src/common/gajim.py | 1 - 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index b03ab5d2e..a5df9981b 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -767,31 +767,31 @@ class Connection: proxy = {'host': proxyhost, 'port': proxyport} else: proxy = None - c = common.xmpp.Client(server = hostname) -# try: - c.connect(proxy = proxy) -# except: -# gajim.log.debug('Couldn\'t connect to %s' % hostname) -# self.dispatch('ERROR', _('Couldn\'t connect to ') + hostname) -# return 0 -# else: - gajim.log.debug('Connected to server') - req = common.xmpp.features.getRegInfo(c, hostname).asDict() # FIXME! This blocks! - req['username'] = login - req['password'] = password - if not common.xmpp.features.register(c, hostname,req): #FIXME: error - self.dispatch('ERROR', _('Error: ') + c.lastErr) + c = common.xmpp.Client(server = hostname, debug = []) + try: + c.connect(proxy = proxy) + except: + gajim.log.debug('Couldn\'t connect to %s' % hostname) + self.dispatch('ERROR', _('Couldn\'t connect to ') + hostname) + return 0 else: - self.name = name - self.connected = 0 - self.password = password - if USE_GPG: - self.gpg = GnuPG.GnuPG() - gajim.config.set('usegpg', True) + gajim.log.debug(_('Connected to server')) + req = common.xmpp.features.getRegInfo(c, hostname).asDict() # FIXME! This blocks! + req['username'] = login + req['password'] = password + if not common.xmpp.features.register(c, hostname,req): #FIXME: error + self.dispatch('ERROR', _('Error: ') + c.lastErr) else: - gajim.config.set('usegpg', False) - self.dispatch('ACC_OK', (hostname, login, password, name, - resource, prio, use_proxy, proxyhost, proxyport)) + self.name = name + self.connected = 0 + self.password = password + if USE_GPG: + self.gpg = GnuPG.GnuPG() + gajim.config.set('usegpg', True) + else: + gajim.config.set('usegpg', False) + self.dispatch('ACC_OK', (hostname, login, password, name, + resource, prio, use_proxy, proxyhost, proxyport)) def account_changed(self, new_name): self.name = new_name diff --git a/src/common/gajim.py b/src/common/gajim.py index 135411596..a16c1824f 100644 --- a/src/common/gajim.py +++ b/src/common/gajim.py @@ -25,5 +25,4 @@ version = '0.7' config = common.config.Config() connections = {} log = logging.getLogger('Gajim') -log.setLevel(logging.DEBUG) logger = common.logger.Logger()