summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2020-05-22 01:58:03 +0200
committermathieui <mathieui@mathieui.net>2020-05-23 16:10:13 +0200
commitd3655c4c3520f1a86af5ccf7b816076ae1d18312 (patch)
treec570528a54256c6fa44c144ceb899f839dc3ca3a
parent36c85a5df4fc4650956bc3aa9d4e8474268a06a9 (diff)
downloadpoezio-d3655c4c3520f1a86af5ccf7b816076ae1d18312.tar.gz
poezio-d3655c4c3520f1a86af5ccf7b816076ae1d18312.tar.bz2
poezio-d3655c4c3520f1a86af5ccf7b816076ae1d18312.tar.xz
poezio-d3655c4c3520f1a86af5ccf7b816076ae1d18312.zip
Fix some remaining refresh issues
-rw-r--r--poezio/mam.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/poezio/mam.py b/poezio/mam.py
index 6882ef7a..edd1e462 100644
--- a/poezio/mam.py
+++ b/poezio/mam.py
@@ -212,7 +212,8 @@ async def fill_missing_history(tab: tabs.Tab, gap: HistoryGap) -> None:
try:
messages = await fetch_history(tab, start=start, end=end, amount=999)
tab._text_buffer.add_history_messages(messages, gap=gap)
- tab.core.refresh_window()
+ if messages:
+ tab.core.refresh_window()
except (NoMAMSupportException, MAMQueryException, DiscoInfoException):
return
finally:
@@ -230,6 +231,8 @@ async def on_new_tab_open(tab: tabs.Tab) -> None:
try:
messages = await fetch_history(tab, end=end, amount=amount)
tab._text_buffer.add_history_messages(messages)
+ if messages:
+ tab.core.refresh_window()
except (NoMAMSupportException, MAMQueryException, DiscoInfoException):
return None
finally:
@@ -282,6 +285,8 @@ async def on_scroll_up(tab) -> None:
time = tab._text_buffer.messages[0].time
messages = [EndOfArchive('End of archive reached', time=time)]
tab._text_buffer.add_history_messages(messages)
+ if messages:
+ tab.core.refresh_window()
except NoMAMSupportException:
tab.core.information('MAM not supported for %r' % tab.jid, 'Info')
return None