summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2018-01-16 00:05:02 +0100
committermathieui <mathieui@mathieui.net>2018-01-16 00:05:02 +0100
commit323b77c2f4e94f063ba32924f475b1021d7e7a7f (patch)
treece02789b5292b33a90b557af900a367fc15a41ca
parent020c7db1ae21201e493b2b02bedc8e7855fa20da (diff)
downloadpoezio-323b77c2f4e94f063ba32924f475b1021d7e7a7f.tar.gz
poezio-323b77c2f4e94f063ba32924f475b1021d7e7a7f.tar.bz2
poezio-323b77c2f4e94f063ba32924f475b1021d7e7a7f.tar.xz
poezio-323b77c2f4e94f063ba32924f475b1021d7e7a7f.zip
Current tab input is refreshed on kick/ban even when it does not exist
leading to tracebacks and shenanigans
-rw-r--r--poezio/tabs/basetabs.py6
-rw-r--r--poezio/tabs/muctab.py6
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',