From 68fdb002df4bb34a536f28840afc031a6784968a Mon Sep 17 00:00:00 2001 From: Jean-Marie Traissard Date: Mon, 21 Apr 2008 16:35:39 +0000 Subject: [PATCH] Use good message time --- src/common/connection_handlers.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py index df9ded239..980ea9e7a 100644 --- a/src/common/connection_handlers.py +++ b/src/common/connection_handlers.py @@ -1662,16 +1662,17 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco, return self.dispatch('GC_MSG', (frm, msgtxt, tim, has_timestamp, msghtml, statusCode)) + tim_int = int(float(mktime(tim))) if self.name not in no_log_for and jid not in no_log_for and not \ - int(float(mktime(tim))) <= self.last_history_time[jid] and msgtxt \ + tim_int <= self.last_history_time[jid] and msgtxt \ and frm.find('/') >= 0: # if frm.find('/') < 0, it means message comes from room itself # usually it hold description and can be send at each connection # so don't store it in logs try: gajim.logger.write('gc_msg', frm, msgtxt, tim = tim) - # save the time we quit to avoid duplicate logs - self.last_history_time[jid] = time_time() + # save the time we log to avoid duplicate logs + self.last_history_time[jid] = tim_int except exceptions.PysqliteOperationalError, e: self.dispatch('ERROR', (_('Disk Write Error'), str(e))) return