Also write additional_data to history db when mam messages are received.

This commit is contained in:
tmolitor 2016-09-05 21:17:46 +02:00
parent baff629433
commit 95eb7402a4
2 changed files with 3 additions and 3 deletions

View file

@ -1110,7 +1110,7 @@ class Logger:
(account_jid_id,)) (account_jid_id,))
self._timeout_commit() self._timeout_commit()
def save_if_not_exists(self, with_, direction, tim, msg='', nick=None): def save_if_not_exists(self, with_, direction, tim, msg='', nick=None, additional_data={}):
if tim: if tim:
time_col = int(float(time.mktime(tim))) time_col = int(float(time.mktime(tim)))
else: else:
@ -1154,7 +1154,7 @@ class Logger:
log.debug('Log already in DB, ignoring it') log.debug('Log already in DB, ignoring it')
return return
log.debug('New log received from server archives, storing it') log.debug('New log received from server archives, storing it')
self.write(type_, with_, message=msg, tim=tim) self.write(type_, with_, message=msg, tim=tim, additional_data=additional_data)
def _nec_gc_message_received(self, obj): def _nec_gc_message_received(self, obj):
tim_f = float(time.mktime(obj.timestamp)) tim_f = float(time.mktime(obj.timestamp))

View file

@ -113,7 +113,7 @@ class ConnectionArchive313(ConnectionArchive):
if obj.conn.name != self.name: if obj.conn.name != self.name:
return return
gajim.logger.save_if_not_exists(obj.with_, obj.direction, obj.tim, gajim.logger.save_if_not_exists(obj.with_, obj.direction, obj.tim,
msg=obj.msgtxt, nick=obj.nick) msg=obj.msgtxt, nick=obj.nick, additional_data=obj.additional_data)
def request_archive(self, start=None, end=None, with_=None, after=None, def request_archive(self, start=None, end=None, with_=None, after=None,
max=30): max=30):