diff --git a/gajim/common/jingle_ftstates.py b/gajim/common/jingle_ftstates.py index d20a9146b..b07dd7bc6 100644 --- a/gajim/common/jingle_ftstates.py +++ b/gajim/common/jingle_ftstates.py @@ -159,8 +159,7 @@ class StateTransfering(JingleFileTransferStates): mode = 'server' streamhost_used = self.jft.nominated_cand['peer-cand'] gajim.socks5queue.remove_client(self.jft.file_props.transport_sid) -# our_cand = self.jft.nominated_cand['our-cand'] -# gajim.socks5queue.remove_receiver(our_cand['idx']) + gajim.socks5queue.remove_other_servers(streamhost_used['host']) if streamhost_used['type'] == 'proxy': self.jft.file_props.is_a_proxy = True if self.jft.file_props.type_ == 's' and self.jft.weinitiate: diff --git a/gajim/common/socks5.py b/gajim/common/socks5.py index ff658d785..1bc676e8f 100644 --- a/gajim/common/socks5.py +++ b/gajim/common/socks5.py @@ -398,12 +398,11 @@ class SocksQueue: sender = self.senders[key] if do_disconnect: sender.disconnect() - else: - self.idlequeue.unplug_idle(sender.fd) - self.idlequeue.remove_timeout(sender.fd) - del(self.senders[key]) - if self.connected > 0: - self.connected -= 1 + self.idlequeue.unplug_idle(sender.fd) + self.idlequeue.remove_timeout(sender.fd) + del(self.senders[key]) + if self.connected > 0: + self.connected -= 1 def remove_receiver(self, idx, do_disconnect=True, remove_all=False): """ @@ -448,6 +447,11 @@ class SocksQueue: def remove_client(self, transport_sid, do_disconnect=True): self.remove_by_mode(transport_sid, 'client') + def remove_other_servers(self, host_to_keep): + for (key, sock) in self.senders.copy().items(): + if sock.host != host_to_keep and sock.mode == 'server': + self.remove_sender_by_key(key) + class Socks5(object): def __init__(self, idlequeue, host, port, initiator, target, sid): if host is not None: diff --git a/gajim/filetransfers_window.py b/gajim/filetransfers_window.py index 02564176f..f41ccc5c6 100644 --- a/gajim/filetransfers_window.py +++ b/gajim/filetransfers_window.py @@ -212,8 +212,8 @@ class FileTransfersWindow: sectext += recipient if file_props.type_ == 'r': sectext += '\n\t' + _('Saved in: %s') % file_path - dialog = dialogs.HigDialog(None, Gtk.MessageType.INFO, Gtk.ButtonsType.NONE, - _('File transfer completed'), sectext) + dialog = dialogs.HigDialog(gajim.interface.roster.window, Gtk.MessageType.INFO, + Gtk.ButtonsType.NONE, _('File transfer completed'), sectext) if file_props.type_ == 'r': button = Gtk.Button.new_with_mnemonic(_('Open _Containing Folder')) button.connect('clicked', on_open, file_props)