log sent messages only once. fixes #3398
This commit is contained in:
parent
465b2f20c3
commit
08201d4648
|
@ -905,7 +905,7 @@ class Connection(ConnectionHandlers):
|
||||||
msg_iq = session.encrypt_stanza(msg_iq)
|
msg_iq = session.encrypt_stanza(msg_iq)
|
||||||
|
|
||||||
self.connection.send(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')\
|
no_log_for = gajim.config.get_per('accounts', self.name, 'no_log_for')\
|
||||||
.split()
|
.split()
|
||||||
ji = gajim.get_jid_without_resource(jid)
|
ji = gajim.get_jid_without_resource(jid)
|
||||||
|
@ -924,18 +924,6 @@ class Connection(ConnectionHandlers):
|
||||||
self.dispatch('ERROR', (_('Disk Write Error'), str(e)))
|
self.dispatch('ERROR', (_('Disk Write Error'), str(e)))
|
||||||
self.dispatch('MSGSENT', (jid, msg, keyID))
|
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):
|
def send_stanza(self, stanza):
|
||||||
''' send a stanza untouched '''
|
''' send a stanza untouched '''
|
||||||
if not self.connection:
|
if not self.connection:
|
||||||
|
|
Loading…
Reference in New Issue