Yann Leboulanger pushed to branch master at gajim / gajim

Commits:
388acfca by Yann Leboulanger at 2017-06-14T15:29:19+02:00
fix logging single messages. Fixes #8640

- - - - -


2 changed files:

- src/common/connection.py
- src/common/zeroconf/connection_zeroconf.py


Changes:

=====================================
src/common/connection.py
=====================================
--- 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'):
         """


=====================================
src/common/zeroconf/connection_zeroconf.py
=====================================
--- 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.')



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/388acfca5a672a004e205d2c8083ab55bb835a12
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to