From 388acfca5a672a004e205d2c8083ab55bb835a12 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 14 Jun 2017 15:29:19 +0200 Subject: [PATCH] fix logging single messages. Fixes #8640 --- src/common/connection.py | 10 +++++----- src/common/zeroconf/connection_zeroconf.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index f498116ff..4fb178eec 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -413,14 +413,14 @@ class CommonConnection: gajim.nec.push_incoming_event( StanzaMessageOutgoingEvent(None, **vars(obj))) - def log_message(self, obj): + def log_message(self, obj, jid): if not obj.is_loggable: return if obj.forward_from or not obj.session or not obj.session.is_loggable(): return - if not gajim.config.should_log(self.name, obj.jid): + if not gajim.config.should_log(self.name, jid): return if obj.xhtml and gajim.config.get('log_xhtml_messages'): @@ -437,7 +437,7 @@ class CommonConnection: kind = 'single_msg_sent' gajim.logger.write( - kind, obj.jid, message, subject=obj.subject, + kind, jid, message, subject=obj.subject, additional_data=obj.additional_data) def ack_subscribed(self, jid): @@ -2058,9 +2058,9 @@ class Connection(CommonConnection, ConnectionHandlers): for j in obj.jid: if obj.session is None: obj.session = self.get_or_create_session(j, '') - self.log_message(obj) + self.log_message(obj, j) else: - self.log_message(obj) + self.log_message(obj, obj.jid) def send_contacts(self, contacts, fjid, type_='message'): """ diff --git a/src/common/zeroconf/connection_zeroconf.py b/src/common/zeroconf/connection_zeroconf.py index 27fb610d1..2446a5e37 100644 --- a/src/common/zeroconf/connection_zeroconf.py +++ b/src/common/zeroconf/connection_zeroconf.py @@ -342,7 +342,7 @@ class ConnectionZeroconf(CommonConnection, ConnectionHandlersZeroconf): if obj.callback: obj.callback(obj.msg_iq, *obj.callback_args) - self.log_message(obj) + self.log_message(obj, obj.jid) def on_send_not_ok(reason): reason += ' ' + _('Your message could not be sent.')