From 8ede65961f2ded53d52d3579899e87ea8d883210 Mon Sep 17 00:00:00 2001 From: Dimitur Kirov Date: Mon, 1 Aug 2005 22:45:29 +0000 Subject: [PATCH] moved socks5queue to gajim.py --- src/common/connection.py | 12 +++++------- src/common/gajim.py | 1 + 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index 8e5451267..59fec0336 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -143,8 +143,6 @@ class Connection: self.last_sent = [] self.password = gajim.config.get_per('accounts', name, 'password') self.privacy_rules_supported = False - self.receiver = socks5.SocksQueue(self.complete_file_transfer, - self.file_transfer_progress) if USE_GPG: self.gpg = GnuPG.GnuPG() gajim.config.set('usegpg', True) @@ -386,7 +384,8 @@ class Connection: id = str(iq_obj.getAttr('id')) query = iq_obj.getTag('query') sid = str(query.getAttr('sid')) - file_props = self.receiver.get_file_props(sid) + file_props = gajim.socks5queue.get_file_props( + self.name, sid) if file_props is None: return # todo - error @@ -407,7 +406,7 @@ class Connection: sock5 = socks5.Socks5Receiver(host = streamhost['host'], \ port = int(streamhost['port']), initiator = streamhost['jid'], target = target, sid = sid, file_props = file_props) - ret = self.receiver.add_receiver(sock5) + ret = gajim.socks5queue.add_receiver(self.name, sock5) if ret is None: continue iq = common.xmpp.Iq(to = streamhost['jid'], typ = 'result', frm = target) @@ -474,7 +473,7 @@ class Connection: file_props['sender'] = iq_obj.getFrom() file_props['request-id'] = str(iq_obj.getAttr('id')) file_props['sid'] = str(si.getAttr('id')) - self.receiver.add_file_props(file_props) + gajim.socks5queue.add_file_props(self.name, file_props) self.dispatch('FILE_REQUEST', (jid, file_props)) raise common.xmpp.NodeProcessed @@ -839,6 +838,7 @@ class Connection: p = gajim.config.get_per('accounts', self.name, 'custom_port') con_type = con.connect((h, p), proxy = proxy, secure=secur) #FIXME: blocking + self.peerhost = con.get_peerhost() if not con_type: gajim.log.debug("Couldn't connect to %s" % self.name) self.connected = 0 @@ -1507,8 +1507,6 @@ class Connection: return if self.connection: self.connection.Process(timeout) - if self.receiver.connected > 0: - self.receiver.process(timeout) except: gajim.log.debug(_('error appeared while processing xmpp:')) traceback.print_exc() diff --git a/src/common/gajim.py b/src/common/gajim.py index c8186270d..70c96c9ac 100644 --- a/src/common/gajim.py +++ b/src/common/gajim.py @@ -63,6 +63,7 @@ sleeper_state = {} # whether we pass auto away / xa or not #'autoxa': autoxa and use sleeper status_before_autoaway = {} +socks5quue = None def get_fjid_from_nick(room_jid, nick): # fake jid is the jid for a contact in a room