Use good message time
This commit is contained in:
parent
94580b3019
commit
68fdb002df
|
@ -1662,16 +1662,17 @@ class ConnectionHandlers(ConnectionVcard, ConnectionBytestream, ConnectionDisco,
|
||||||
return
|
return
|
||||||
self.dispatch('GC_MSG', (frm, msgtxt, tim, has_timestamp, msghtml,
|
self.dispatch('GC_MSG', (frm, msgtxt, tim, has_timestamp, msghtml,
|
||||||
statusCode))
|
statusCode))
|
||||||
|
tim_int = int(float(mktime(tim)))
|
||||||
if self.name not in no_log_for and jid not in no_log_for and not \
|
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:
|
and frm.find('/') >= 0:
|
||||||
# if frm.find('/') < 0, it means message comes from room itself
|
# if frm.find('/') < 0, it means message comes from room itself
|
||||||
# usually it hold description and can be send at each connection
|
# usually it hold description and can be send at each connection
|
||||||
# so don't store it in logs
|
# so don't store it in logs
|
||||||
try:
|
try:
|
||||||
gajim.logger.write('gc_msg', frm, msgtxt, tim = tim)
|
gajim.logger.write('gc_msg', frm, msgtxt, tim = tim)
|
||||||
# save the time we quit to avoid duplicate logs
|
# save the time we log to avoid duplicate logs
|
||||||
self.last_history_time[jid] = time_time()
|
self.last_history_time[jid] = tim_int
|
||||||
except exceptions.PysqliteOperationalError, e:
|
except exceptions.PysqliteOperationalError, e:
|
||||||
self.dispatch('ERROR', (_('Disk Write Error'), str(e)))
|
self.dispatch('ERROR', (_('Disk Write Error'), str(e)))
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue