summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-02-15 22:18:18 +0100
committermathieui <mathieui@mathieui.net>2012-02-15 22:18:18 +0100
commit6f34260d89728eef9970412789541a181c096a4d (patch)
treeee45803c8ff0401e41b9cf155c5048e026eb9c80
parenta78fb1f62d43d8003d5a9d583a4ccb9e548b144f (diff)
downloadpoezio-6f34260d89728eef9970412789541a181c096a4d.tar.gz
poezio-6f34260d89728eef9970412789541a181c096a4d.tar.bz2
poezio-6f34260d89728eef9970412789541a181c096a4d.tar.xz
poezio-6f34260d89728eef9970412789541a181c096a4d.zip
Disconnected tabs remain visible until closed or rejoined
Fixes #2314
-rw-r--r--src/tabs.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/tabs.py b/src/tabs.py
index f170d738..492a4412 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -163,7 +163,9 @@ class Tab(object):
log.debug("Invalid value for tab state: %s", value)
elif STATE_PRIORITY[value] < STATE_PRIORITY[self._state] and \
value not in ('current', 'disconnected'):
- log.debug("Did not set status because of lower priority, asked: %s, kept: %s", value, self._state)
+ log.debug("Did not set state because of lower priority, asked: %s, kept: %s", value, self._state)
+ elif self._state == 'disconnected' and value not in ('joined', 'current'):
+ log.debug('Did not set state because disconnected tabs remain visible')
else:
self._state = value
@@ -1036,7 +1038,10 @@ class MucTab(ChatTab):
return self.text_win
def on_lose_focus(self):
- self.state = 'normal'
+ if self.joined:
+ self.state = 'normal'
+ else:
+ self.state = 'disconnected'
self.text_win.remove_line_separator()
self.text_win.add_line_separator()
if config.get_by_tabname('send_chat_states', 'true', self.general_jid, True) == 'true' and not self.input.get_text():
@@ -1299,7 +1304,8 @@ class MucTab(ChatTab):
we can know if we can join it, send messages to it, etc
"""
self.users = []
- self.state = 'disconnected'
+ if self is not self.core.current_tab():
+ self.state = 'disconnected'
self.joined = False
def get_single_line_topic(self):