From 32309d2a30fb3ae657b7b5b022b78d936a19d772 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Thu, 5 Nov 2009 19:11:31 +0100 Subject: [PATCH 01/16] [marcin.bachry] disconnect once proxy has been tested. Fixes #5409 --- src/common/proxy65_manager.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common/proxy65_manager.py b/src/common/proxy65_manager.py index e90cf57d7..b1bbea79d 100644 --- a/src/common/proxy65_manager.py +++ b/src/common/proxy65_manager.py @@ -286,7 +286,10 @@ class HostTester(Socks5, IdleObject): elif self.state == 3: log.debug('Host authenticated to %s:%s' % (self.host, self.port)) self.on_success() + self.disconnect() self.state += 1 + else: + assert False, 'unexpected state: %d' % self.state def do_connect(self): try: @@ -402,7 +405,10 @@ class ReceiverTester(Socks5, IdleObject): return log.debug('Receiver authenticated to %s:%s' % (self.host, self.port)) self.on_success() + self.disconnect() self.state += 1 + else: + assert False, 'unexpected state: %d' % self.state def do_connect(self): try: From c8cc5be366ec8c4d87e0e329f3df29cf22a3a9d8 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Thu, 5 Nov 2009 19:14:19 +0100 Subject: [PATCH 02/16] don't print libasyncns warning on stdout. Fixes #5407 --- src/common/resolver.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/common/resolver.py b/src/common/resolver.py index 0be528f38..b11abcd98 100644 --- a/src/common/resolver.py +++ b/src/common/resolver.py @@ -41,14 +41,6 @@ except ImportError: USE_LIBASYNCNS = False log.debug("Import of libasyncns-python failed, getaddrinfo will block", exc_info=True) - # FIXME: Remove these prints before release, replace with a warning dialog. - print >> sys.stderr, "=" * 79 - print >> sys.stderr, "libasyncns-python not installed which means:" - print >> sys.stderr, " - nslookup will be used for SRV and TXT requests" - print >> sys.stderr, " - getaddrinfo will block" - print >> sys.stderr, "libasyncns-python can be found at https://launchpad.net/libasyncns-python" - print >> sys.stderr, "=" * 79 - def get_resolver(idlequeue): if USE_LIBASYNCNS: From eb32680a91c65827a4a8f676f5f7751288e49591 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Thu, 5 Nov 2009 19:24:27 +0100 Subject: [PATCH 03/16] fix caps query verification. --- src/common/caps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/caps.py b/src/common/caps.py index b3fe72e9c..348eb6813 100644 --- a/src/common/caps.py +++ b/src/common/caps.py @@ -199,7 +199,7 @@ class NullClientCaps(AbstractClientCaps): def _lookup_in_cache(self, caps_cache): # lookup something which does not exist to get a new CacheItem created cache_item = caps_cache[('dummy', '')] - assert cache_item.queried == 0 + assert cache_item.queried != 2 return cache_item def _discover(self, connection, jid): From 4743d224fda422782d69239744294376c978ea8d Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Thu, 5 Nov 2009 19:44:01 +0100 Subject: [PATCH 04/16] fix sending message to several contacts (in this case we cannot get a contact instance as there are several jids in one. Fixes #5408 --- src/common/connection.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index 78422545f..eae9cdac0 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -1298,7 +1298,7 @@ class Connection(ConnectionHandlers): # chatstates - if peer supports xep85 or xep22, send chatstates # please note that the only valid tag inside a message containing a # tag is the active event - if chatstate is not None: + if chatstate is not None and contact: if ((composing_xep == 'XEP-0085' or not composing_xep) \ and composing_xep != 'asked_once') or \ contact.supports(common.xmpp.NS_CHATSTATES): @@ -1327,7 +1327,8 @@ class Connection(ConnectionHandlers): # XEP-0184 if msgtxt and gajim.config.get_per('accounts', self.name, - 'request_receipt') and contact.supports(common.xmpp.NS_RECEIPTS): + 'request_receipt') and contact and contact.supports( + common.xmpp.NS_RECEIPTS): msg_iq.setTag('request', namespace=common.xmpp.NS_RECEIPTS) if session: From dec49976c4057a54c53917e73c13bdd64a8dd6d0 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Thu, 5 Nov 2009 22:20:45 +0100 Subject: [PATCH 05/16] Use a separate label in RIE dialog instead of a stock button. This way we can change label easily. --- data/glade/roster_item_exchange_window.glade | 34 ++++++++++++++++++-- src/dialogs.py | 14 +++----- 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/data/glade/roster_item_exchange_window.glade b/data/glade/roster_item_exchange_window.glade index c3079dc6c..0bad50833 100644 --- a/data/glade/roster_item_exchange_window.glade +++ b/data/glade/roster_item_exchange_window.glade @@ -85,12 +85,42 @@ - gtk-ok True True True - True + + + True + + + True + 3 + + + True + 1 + gtk-ok + + + 0 + + + + + True + 0 + _OK + True + + + 1 + + + + + + False diff --git a/src/dialogs.py b/src/dialogs.py index 3233855ea..f79a8d374 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -2862,7 +2862,7 @@ class RosterItemExchangeWindow: self.window = self.xml.get_widget('roster_item_exchange_window') # Add Widgets. - for widget_to_add in ['cancel_button', 'accept_button', 'type_label', + for widget_to_add in ['accept_button_label', 'type_label', 'body_scrolledwindow', 'body_textview', 'items_list_treeview']: self.__dict__[widget_to_add] = self.xml.get_widget(widget_to_add) @@ -2930,9 +2930,7 @@ class RosterItemExchangeWindow: model.set(iter, 0, True, 1, jid, 2, name, 3, groups) # Change label for accept_button to action name instead of 'OK'. - accept_button_label = self.accept_button.get_children()[0].\ - get_children()[0].get_children()[1] - accept_button_label.set_label(_('Add')) + self.accept_button_label.set_label(_('Add')) elif action == 'modify': for jid in self.exchange_list: groups = '' @@ -2963,9 +2961,7 @@ class RosterItemExchangeWindow: model.set(iter, 0, True, 1, jid, 2, name, 3, groups) # Change label for accept_button to action name instead of 'OK'. - accept_button_label = self.accept_button.get_children()[0].\ - get_children()[0].get_children()[1] - accept_button_label.set_label(_('Modify')) + self.accept_button_label.set_label(_('Modify')) elif action == 'delete': for jid in self.exchange_list: groups = '' @@ -2989,9 +2985,7 @@ class RosterItemExchangeWindow: model.set(iter, 0, True, 1, jid, 2, name, 3, groups) # Change label for accept_button to action name instead of 'OK'. - accept_button_label = self.accept_button.get_children()[0].\ - get_children()[0].get_children()[1] - accept_button_label.set_label(_('Delete')) + self.accept_button_label.set_label(_('Delete')) if show_dialog: self.window.show_all() From ea5429b248be7165169a96bde7b565ea27eb2885 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Fri, 6 Nov 2009 08:11:07 +0100 Subject: [PATCH 06/16] fix XEP-202 implementation, child element must be