Use good message time

This commit is contained in:
Jean-Marie Traissard 2008-04-21 16:35:39 +00:00
parent 94580b3019
commit 68fdb002df
1 changed files with 4 additions and 3 deletions

View File

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