Use correct history date on muc join

Example:
If we receive a message the last message date is now.
If we restart Gajim and join the MUC again, `time.time() - timeout`
will be most likly smaller then when we received the last message
If the timeout is an hour, this would mean that many messages are requested
from the archive which we already received.

So we always want the most current timestamp (MAX).
This commit is contained in:
Philipp Hörist 2017-07-10 16:39:27 +02:00
parent 5a8965791c
commit aeb64a516c
1 changed files with 1 additions and 1 deletions

View File

@ -2598,7 +2598,7 @@ class Connection(CommonConnection, ConnectionHandlers):
if last_date == 0:
last_date = time.time() - timeout
elif not rejoin:
last_date = min(last_date, time.time() - timeout)
last_date = max(last_date, time.time() - timeout)
last_date = time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime(
last_date))
tags['since'] = last_date