summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2020-05-28 21:55:28 +0200
committermathieui <mathieui@mathieui.net>2020-05-28 21:55:51 +0200
commit64561bcfb61d9e6493ce8d0261f7215eae148600 (patch)
tree9e206078498b17f89ec00e6ec0071a36c35065de
parent1595741e7aaaeda282283530e7ab8cd72cdc4078 (diff)
downloadpoezio-64561bcfb61d9e6493ce8d0261f7215eae148600.tar.gz
poezio-64561bcfb61d9e6493ce8d0261f7215eae148600.tar.bz2
poezio-64561bcfb61d9e6493ce8d0261f7215eae148600.tar.xz
poezio-64561bcfb61d9e6493ce8d0261f7215eae148600.zip
Fix an issue on join when the room has no MAM support
The value of the "seconds" attribute was borked, resulting in a traceback.
-rw-r--r--poezio/tabs/muctab.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/poezio/tabs/muctab.py b/poezio/tabs/muctab.py
index ace0df99..63bf026e 100644
--- a/poezio/tabs/muctab.py
+++ b/poezio/tabs/muctab.py
@@ -159,7 +159,10 @@ class MucTab(ChatTab):
delta = to_utc(datetime.now()) - to_utc(self.last_connection)
seconds = delta.seconds + delta.days * 24 * 3600
else:
- seconds = self._text_buffer.find_last_message()
+ last_message = self._text_buffer.find_last_message()
+ seconds = None
+ if last_message is not None:
+ seconds = (datetime.now() - last_message.time).seconds
muc.join_groupchat(
self.core,
self.jid.bare,