From e84cbf6ba5b748881ea3f99471a39a8f1fde772a Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Sun, 11 Sep 2011 03:29:27 +0200 Subject: Make the roster tab shine when someone added you in her roster --- src/core.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/core.py') diff --git a/src/core.py b/src/core.py index e25be58f..340cdf8a 100644 --- a/src/core.py +++ b/src/core.py @@ -656,7 +656,7 @@ class Core(object): roster.add_contact(contact, jid) roster.edit_groups_of_contact(contact, []) contact.set_ask('asked') - self.tabs[0].set_color_state(theme.COLOR_TAB_HIGHLIGHT) + self.get_tab_by_number(0).set_color_state(theme.COLOR_TAB_HIGHLIGHT) self.information('%s wants to subscribe to your presence'%jid, 'Roster') if isinstance(self.current_tab(), tabs.RosterInfoTab): self.refresh_window() @@ -758,6 +758,12 @@ class Core(object): return tab return None + def get_tab_by_number(self, number): + for tab in self.tabs: + if tab.nb == number: + return tab + return None + def get_room_by_name(self, name): """ returns the room that has this name -- cgit v1.2.3 From 1a485318bfc1a3db4cd970785029eeb8b03bf0b3 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Sun, 11 Sep 2011 03:32:54 +0200 Subject: Fix a traceback when a contact not yet accepted goes offline --- src/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core.py') diff --git a/src/core.py b/src/core.py index 340cdf8a..4a2cc91f 100644 --- a/src/core.py +++ b/src/core.py @@ -337,7 +337,8 @@ class Core(object): return log.debug('on_got_offline: %s' % presence) resource = contact.get_resource_by_fulljid(jid.full) - assert resource + if not resource: + return # If a resource got offline, display the message in the conversation with this # precise resource. self.add_information_message_to_conversation_tab(jid.full, '\x195%s is \x191offline' % (resource.get_jid().full)) -- cgit v1.2.3