Fix an issue on join when the room has no MAM support

The value of the "seconds" attribute was borked, resulting in a
traceback.
This commit is contained in:
mathieui 2020-05-28 21:55:28 +02:00
parent 1595741e7a
commit 64561bcfb6

View file

@ -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,