From 323b77c2f4e94f063ba32924f475b1021d7e7a7f Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 16 Jan 2018 00:05:02 +0100 Subject: Current tab input is refreshed on kick/ban even when it does not exist leading to tracebacks and shenanigans --- poezio/tabs/basetabs.py | 6 ++++++ poezio/tabs/muctab.py | 6 ++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py index 135c0b84..a4e9d949 100644 --- a/poezio/tabs/basetabs.py +++ b/poezio/tabs/basetabs.py @@ -323,6 +323,12 @@ class Tab(object): elif not self.size.core_degrade_y: self.core.tab_win.refresh() + def refresh_input(self): + """Refresh the current input if any""" + if self.input is not None: + self.input.refresh() + self.core.doupdate() + def refresh(self): """ Called on each screen refresh (when something has changed) diff --git a/poezio/tabs/muctab.py b/poezio/tabs/muctab.py index 91d8b986..fa08ca55 100644 --- a/poezio/tabs/muctab.py +++ b/poezio/tabs/muctab.py @@ -720,8 +720,7 @@ class MucTab(ChatTab): self.core.disable_private_tabs(self.name, reason=kick_msg) self.disconnect() self.refresh_tab_win() - self.core.current_tab().input.refresh() - self.core.doupdate() + self.core.current_tab().refresh_input() if config.get_by_tabname('autorejoin', self.general_jid): delay = config.get_by_tabname('autorejoin_delay', self.general_jid) @@ -799,8 +798,7 @@ class MucTab(ChatTab): self.core.disable_private_tabs(self.name, reason=kick_msg) self.disconnect() self.refresh_tab_win() - self.core.current_tab().input.refresh() - self.core.doupdate() + self.core.current_tab().refresh_input() # try to auto-rejoin if config.get_by_tabname('autorejoin', self.general_jid): delay = config.get_by_tabname('autorejoin_delay', -- cgit v1.2.3