Skip to content
Snippets Groups Projects
Commit 08201d46 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

log sent messages only once. fixes #3398

parent 465b2f20
No related branches found
No related tags found
No related merge requests found
......@@ -905,7 +905,7 @@ class Connection(ConnectionHandlers):
msg_iq = session.encrypt_stanza(msg_iq)
self.connection.send(msg_iq)
if not forward_from:
if not forward_from and session.is_loggable():
no_log_for = gajim.config.get_per('accounts', self.name, 'no_log_for')\
.split()
ji = gajim.get_jid_without_resource(jid)
......@@ -922,20 +922,8 @@ class Connection(ConnectionHandlers):
gajim.logger.write(kind, jid, log_msg)
except exceptions.PysqliteOperationalError, e:
self.dispatch('ERROR', (_('Disk Write Error'), str(e)))
self.dispatch('MSGSENT', (jid, msg, keyID))
if session.is_loggable():
log_msg = msg
if subject:
log_msg = _('Subject: %s\n%s') % (subject, msg)
if log_msg:
if type == 'chat':
kind = 'chat_msg_sent'
else:
kind = 'single_msg_sent'
gajim.logger.write(kind, jid, log_msg)
self.dispatch('MSGSENT', (jid, msg, keyID))
def send_stanza(self, stanza):
''' send a stanza untouched '''
if not self.connection:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment