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