summaryrefslogtreecommitdiff
path: root/poezio/mam.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2020-05-22 17:09:17 +0200
committermathieui <mathieui@mathieui.net>2020-05-23 16:10:13 +0200
commit29eef159d50c836fbd7a27770775d63700dc7f19 (patch)
treeae17eb3f41a87974b6c9af0f3335ffa5a4b5fe17 /poezio/mam.py
parentd3655c4c3520f1a86af5ccf7b816076ae1d18312 (diff)
downloadpoezio-29eef159d50c836fbd7a27770775d63700dc7f19.tar.gz
poezio-29eef159d50c836fbd7a27770775d63700dc7f19.tar.bz2
poezio-29eef159d50c836fbd7a27770775d63700dc7f19.tar.xz
poezio-29eef159d50c836fbd7a27770775d63700dc7f19.zip
Fix some edge cases of MAM history fetch
- Wait until we receive our own MUC presence to fetch history - Fix /reconnect weirdness
Diffstat (limited to 'poezio/mam.py')
-rw-r--r--poezio/mam.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/poezio/mam.py b/poezio/mam.py
index edd1e462..ee5b1be8 100644
--- a/poezio/mam.py
+++ b/poezio/mam.py
@@ -247,10 +247,10 @@ def schedule_tab_open(tab: tabs.Tab) -> None:
async def on_tab_open(tab: tabs.Tab) -> None:
gap = tab._text_buffer.find_last_gap_muc()
- if gap is not None:
- await fill_missing_history(tab, gap)
- else:
+ if gap is None or not gap.leave_message:
await on_new_tab_open(tab)
+ else:
+ await fill_missing_history(tab, gap)
def schedule_scroll_up(tab: tabs.Tab) -> None: