From 156cfb55465371ae95ea61cd02cfcfda442cb1f4 Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 8 Oct 2017 21:30:11 +0200 Subject: Fix #3056 (send inactive chatstate when leaving a tab) --- poezio/tabs/conversationtab.py | 4 +--- poezio/tabs/muctab.py | 3 +-- poezio/tabs/privatetab.py | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/poezio/tabs/conversationtab.py b/poezio/tabs/conversationtab.py index 9f7c1391..8c128797 100644 --- a/poezio/tabs/conversationtab.py +++ b/poezio/tabs/conversationtab.py @@ -324,9 +324,7 @@ class ConversationTab(OneToOneTab): self.state = 'normal' self.text_win.remove_line_separator() self.text_win.add_line_separator(self._text_buffer) - if (config.get_by_tabname('send_chat_states', self.general_jid) - and (not self.input.get_text() - or not self.input.get_text().startswith('//'))): + if config.get_by_tabname('send_chat_states', self.general_jid): if resource: self.send_chat_state('inactive') self.check_scrolled() diff --git a/poezio/tabs/muctab.py b/poezio/tabs/muctab.py index a89529be..5382d15a 100644 --- a/poezio/tabs/muctab.py +++ b/poezio/tabs/muctab.py @@ -1035,8 +1035,7 @@ class MucTab(ChatTab): self.state = 'disconnected' self.text_win.remove_line_separator() self.text_win.add_line_separator(self._text_buffer) - if (config.get_by_tabname('send_chat_states', self.general_jid) and - not self.input.get_text()): + if config.get_by_tabname('send_chat_states', self.general_jid): self.send_chat_state('inactive') self.check_scrolled() diff --git a/poezio/tabs/privatetab.py b/poezio/tabs/privatetab.py index 9279929a..ec3ed74a 100644 --- a/poezio/tabs/privatetab.py +++ b/poezio/tabs/privatetab.py @@ -280,7 +280,7 @@ class PrivateTab(OneToOneTab): self.text_win.add_line_separator(self._text_buffer) tab = self.core.get_tab_by_name(safeJID(self.name).bare, MucTab) if tab and tab.joined and config.get_by_tabname('send_chat_states', - self.general_jid) and not self.input.get_text() and self.on: + self.general_jid) and self.on: self.send_chat_state('inactive') self.check_scrolled() -- cgit v1.2.3