diff options
author | mathieui <mathieui@mathieui.net> | 2012-02-15 21:47:09 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2012-02-15 21:47:09 +0100 |
commit | a78fb1f62d43d8003d5a9d583a4ccb9e548b144f (patch) | |
tree | 48f29c4f13709114d88449e9547927bc597af9b7 /src/tabs.py | |
parent | 695a7ebebaf6a277420dcb42cd96d92d77df0379 (diff) | |
download | poezio-a78fb1f62d43d8003d5a9d583a4ccb9e548b144f.tar.gz poezio-a78fb1f62d43d8003d5a9d583a4ccb9e548b144f.tar.bz2 poezio-a78fb1f62d43d8003d5a9d583a4ccb9e548b144f.tar.xz poezio-a78fb1f62d43d8003d5a9d583a4ccb9e548b144f.zip |
Do not show joined tabs on startup
and put 0 priority to disconnected tabs
Diffstat (limited to 'src/tabs.py')
-rw-r--r-- | src/tabs.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/tabs.py b/src/tabs.py index c98bbed4..f170d738 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -86,11 +86,11 @@ VERTICAL_STATE_COLORS = { STATE_PRIORITY = { 'normal': -1, 'current': -1, + 'disconnected': 0, 'message': 1, 'joined': 1, 'highlight': 2, 'private': 2, - 'disconnected': 3, 'attention': 3 } @@ -99,7 +99,11 @@ class Tab(object): tab_core = None def __init__(self): self.input = None - self._state = 'normal' + if isinstance(self, MucTab) and not self.joined: + self._state = 'disconnected' + else: + self._state = 'normal' + self.need_resize = False self.nb = Tab.number Tab.number += 1 @@ -158,7 +162,7 @@ class Tab(object): if not value in STATE_COLORS: log.debug("Invalid value for tab state: %s", value) elif STATE_PRIORITY[value] < STATE_PRIORITY[self._state] and \ - value != 'current' and value != 'joined': + value not in ('current', 'disconnected'): log.debug("Did not set status because of lower priority, asked: %s, kept: %s", value, self._state) else: self._state = value @@ -509,10 +513,10 @@ class MucTab(ChatTab): plugin_commands = {} plugin_keys = {} def __init__(self, jid, nick): + self.joined = False ChatTab.__init__(self) self.own_nick = nick self.name = jid - self.joined = False self.users = [] self.topic = '' self.remote_wants_chatstates = True @@ -1080,8 +1084,11 @@ class MucTab(ChatTab): self.users.append(new_user) if from_nick == self.own_nick: self.joined = True - if self != self.core.current_tab(): - self.state = 'joined' + if self.get_name() in self.core.initial_joins: + self.core.initial_joins.remove(self.get_name()) + self._state = 'normal' + elif self != self.core.current_tab(): + self._state = 'joined' if self.core.current_tab() == self and self.core.status.show not in ('xa', 'away'): self.send_chat_state('active') new_user.color = get_theme().COLOR_OWN_NICK |