From 8a44d31e85bc997255d6514bba1f4ee4a19f2da1 Mon Sep 17 00:00:00 2001 From: Mathieu Pasquet Date: Wed, 29 Jan 2014 16:41:57 +0100 Subject: Add a logging option to the OTR plugin It is tab-specific and off by default. --- src/tabs.py | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/tabs.py b/src/tabs.py index 95eaaae8..37cb6fdf 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -1975,14 +1975,6 @@ class PrivateTab(ChatTab): except: log.error('Unable to correct a message', exc_info=True) - if not replaced: - self.add_message(msg['body'], - nickname=self.core.own_nick or self.own_nick, - forced_user=user, - nick_color=get_theme().COLOR_OWN_NICK, - identifier=msg['id'], - jid=self.core.xmpp.boundjid, - typ=1) if msg['body'].find('\x19') != -1: msg.enable('html') msg['html']['body'] = xhtml.poezio_colors_to_html(msg['body']) @@ -1998,6 +1990,15 @@ class PrivateTab(ChatTab): self.text_win.refresh() self.input.refresh() return + if not replaced: + self.add_message(msg['body'], + nickname=self.core.own_nick or self.own_nick, + forced_user=user, + nick_color=get_theme().COLOR_OWN_NICK, + identifier=msg['id'], + jid=self.core.xmpp.boundjid, + typ=1) + self.last_sent_message = msg msg.send() self.cancel_paused_delay() @@ -3194,13 +3195,6 @@ class ConversationTab(ChatTab): replaced = True except: log.error('Unable to correct a message', exc_info=True) - if not replaced: - self.add_message(msg['body'], - nickname=self.core.own_nick, - nick_color=get_theme().COLOR_OWN_NICK, - identifier=msg['id'], - jid=self.core.xmpp.boundjid, - typ=1) if msg['body'].find('\x19') != -1: msg.enable('html') msg['html']['body'] = xhtml.poezio_colors_to_html(msg['body']) @@ -3216,6 +3210,14 @@ class ConversationTab(ChatTab): self.text_win.refresh() self.input.refresh() return + if not replaced: + self.add_message(msg['body'], + nickname=self.core.own_nick, + nick_color=get_theme().COLOR_OWN_NICK, + identifier=msg['id'], + jid=self.core.xmpp.boundjid, + typ=1) + self.last_sent_message = msg msg.send() self.cancel_paused_delay() -- cgit v1.2.3