diff options
author | mathieui <mathieui@mathieui.net> | 2021-06-26 20:58:23 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2021-06-26 20:59:55 +0200 |
commit | 26505c32df055bfe41c3a852fff1b1eaf5dafda7 (patch) | |
tree | 3896ee6d294e40df8e0da60f2c51a8fcfa335781 | |
parent | 3698b20a47c8154322841a84d5bca0dbc70ac923 (diff) | |
download | poezio-26505c32df055bfe41c3a852fff1b1eaf5dafda7.tar.gz poezio-26505c32df055bfe41c3a852fff1b1eaf5dafda7.tar.bz2 poezio-26505c32df055bfe41c3a852fff1b1eaf5dafda7.tar.xz poezio-26505c32df055bfe41c3a852fff1b1eaf5dafda7.zip |
fix: do not silently traceback on mucs without mam
in mucs, there is no "initial message"
-rw-r--r-- | poezio/tabs/basetabs.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py index 0991c657..e6ea1790 100644 --- a/poezio/tabs/basetabs.py +++ b/poezio/tabs/basetabs.py @@ -1028,12 +1028,15 @@ class OneToOneTab(ChatTab): mam_filler = MAMFiller(logger, self, limit) self.mam_filler = mam_filler - async def fallback_no_mam(): - await mam_filler.done.wait() - if mam_filler.result == 0: - self.handle_message(initial) - - asyncio.ensure_future(fallback_no_mam()) + if initial is not None: + # If there is an initial message, throw it back into the + # text buffer if it cannot be fetched from mam + async def fallback_no_mam(): + await mam_filler.done.wait() + if mam_filler.result == 0: + self.handle_message(initial) + + asyncio.ensure_future(fallback_no_mam()) elif use_log and initial: self.handle_message(initial, display=False) asyncio.ensure_future( |