summaryrefslogtreecommitdiff
path: root/src/core.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-09-11 04:22:04 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-09-11 04:22:04 +0200
commitb7b1faebdb52e8f041867f19f29a08f64cfaf220 (patch)
tree180c45399c1907c853bdf25585ec203c04fc8e9e /src/core.py
parent78c216cd61ab96f7476ce194323517b73b8ee04c (diff)
parentce1fb8af014e90cfc7378022c8cbdd134e45ed4a (diff)
downloadpoezio-b7b1faebdb52e8f041867f19f29a08f64cfaf220.tar.gz
poezio-b7b1faebdb52e8f041867f19f29a08f64cfaf220.tar.bz2
poezio-b7b1faebdb52e8f041867f19f29a08f64cfaf220.tar.xz
poezio-b7b1faebdb52e8f041867f19f29a08f64cfaf220.zip
merge
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