summaryrefslogtreecommitdiff
path: root/src/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/core.py')
-rw-r--r--src/core.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core.py b/src/core.py
index a8fa65a5..8d1fde3a 100644
--- a/src/core.py
+++ b/src/core.py
@@ -355,7 +355,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))
@@ -674,7 +675,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()
@@ -777,6 +778,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