summaryrefslogtreecommitdiff
path: root/src/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/core.py')
-rw-r--r--src/core.py8
1 files changed, 7 insertions, 1 deletions
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