From 95eb7402a404c1650d15108d6f732fd513fdcf71 Mon Sep 17 00:00:00 2001 From: tmolitor Date: Mon, 5 Sep 2016 21:17:46 +0200 Subject: [PATCH] Also write additional_data to history db when mam messages are received. --- src/common/logger.py | 4 ++-- src/common/message_archiving.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/logger.py b/src/common/logger.py index 6d831acdf..28fe1511b 100644 --- a/src/common/logger.py +++ b/src/common/logger.py @@ -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)) diff --git a/src/common/message_archiving.py b/src/common/message_archiving.py index 06e7b4e45..b0ba359d1 100644 --- a/src/common/message_archiving.py +++ b/src/common/message_archiving.py @@ -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):