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,))
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:
time_col = int(float(time.mktime(tim)))
else:
@ -1154,7 +1154,7 @@ class Logger:
log.debug('Log already in DB, ignoring it')
return
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):
tim_f = float(time.mktime(obj.timestamp))

View file

@ -113,7 +113,7 @@ class ConnectionArchive313(ConnectionArchive):
if obj.conn.name != self.name:
return
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,
max=30):