Commit d3655c4c authored by mathieui's avatar mathieui

Fix some remaining refresh issues

parent 36c85a5d
...@@ -212,7 +212,8 @@ async def fill_missing_history(tab: tabs.Tab, gap: HistoryGap) -> None: ...@@ -212,7 +212,8 @@ async def fill_missing_history(tab: tabs.Tab, gap: HistoryGap) -> None:
try: try:
messages = await fetch_history(tab, start=start, end=end, amount=999) messages = await fetch_history(tab, start=start, end=end, amount=999)
tab._text_buffer.add_history_messages(messages, gap=gap) tab._text_buffer.add_history_messages(messages, gap=gap)
tab.core.refresh_window() if messages:
tab.core.refresh_window()
except (NoMAMSupportException, MAMQueryException, DiscoInfoException): except (NoMAMSupportException, MAMQueryException, DiscoInfoException):
return return
finally: finally:
...@@ -230,6 +231,8 @@ async def on_new_tab_open(tab: tabs.Tab) -> None: ...@@ -230,6 +231,8 @@ async def on_new_tab_open(tab: tabs.Tab) -> None:
try: try:
messages = await fetch_history(tab, end=end, amount=amount) messages = await fetch_history(tab, end=end, amount=amount)
tab._text_buffer.add_history_messages(messages) tab._text_buffer.add_history_messages(messages)
if messages:
tab.core.refresh_window()
except (NoMAMSupportException, MAMQueryException, DiscoInfoException): except (NoMAMSupportException, MAMQueryException, DiscoInfoException):
return None return None
finally: finally:
...@@ -282,6 +285,8 @@ async def on_scroll_up(tab) -> None: ...@@ -282,6 +285,8 @@ async def on_scroll_up(tab) -> None:
time = tab._text_buffer.messages[0].time time = tab._text_buffer.messages[0].time
messages = [EndOfArchive('End of archive reached', time=time)] messages = [EndOfArchive('End of archive reached', time=time)]
tab._text_buffer.add_history_messages(messages) tab._text_buffer.add_history_messages(messages)
if messages:
tab.core.refresh_window()
except NoMAMSupportException: except NoMAMSupportException:
tab.core.information('MAM not supported for %r' % tab.jid, 'Info') tab.core.information('MAM not supported for %r' % tab.jid, 'Info')
return None return None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment