From c63b53f0cb42cb50c128e0a0d33eb5eca813544e Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Thu, 22 Sep 2011 11:25:02 +0200
Subject: [PATCH] don't loose in logs MUC messages arriving in the same second.
 Fixes #6860

---
 src/common/logger.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/common/logger.py b/src/common/logger.py
index 6d0297217c..4b013d90b0 100644
--- a/src/common/logger.py
+++ b/src/common/logger.py
@@ -1106,9 +1106,10 @@ class Logger:
         self.write(type_, with_, message=msg, tim=tim)
 
     def _nec_gc_message_received(self, obj):
-        tim_int = int(float(time.mktime(obj.timestamp)))
+        tim_f = float(time.mktime(obj.timestamp))
+        tim_int = int(tim_f)
         if gajim.config.should_log(obj.conn.name, obj.jid) and not \
-        tim_int <= obj.conn.last_history_time[obj.jid] and obj.msgtxt and \
+        tim_int < obj.conn.last_history_time[obj.jid] and obj.msgtxt and \
         obj.nick:
             # if not obj.nick, it means message comes from room itself
             # usually it hold description and can be send at each connection
@@ -1118,7 +1119,7 @@ class Logger:
                 # store in memory time of last message logged.
                 # this will also be saved in rooms_last_message_time table
                 # when we quit this muc
-                obj.conn.last_history_time[obj.jid] = time.mktime(obj.timestamp)
+                obj.conn.last_history_time[obj.jid] = tim_f
 
             except exceptions.PysqliteOperationalError, e:
                 obj.conn.dispatch('DB_ERROR', (_('Disk Write Error'), str(e)))
-- 
GitLab