From 2ac56e6cee572448a13432a3db6d9960aa32985c Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 13 Aug 2013 21:18:44 +0200 Subject: [PATCH] print correctly when we correct a /me message. Fixes #7400 --- src/chat_control.py | 12 ++++++------ src/conversation_textview.py | 8 +++++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/chat_control.py b/src/chat_control.py index 4bb3e92c7..a726bdcd3 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -1359,8 +1359,8 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): self.orig_msg = msg_buf.get_text(start_iter, end_iter, 0).decode( 'utf-8') if pos == size and size > 0 and direction == 'up' and \ - msg_type == 'sent' and not self.correcting and not \ - history[pos - 1].startswith('/'): + msg_type == 'sent' and not self.correcting and (not \ + history[pos - 1].startswith('/') or history[pos - 1].startswith('/me')): self.correcting = True self.old_message_tv_color = self.msg_textview.get_style().base[0] self.msg_textview.modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse( @@ -2985,14 +2985,14 @@ class ChatControl(ChatControlBase): xhtml = None if row[2].startswith('Message was corrected. Last message was:\n %s') % \ old_txt @@ -1333,6 +1336,9 @@ class ConversationTextview(gobject.GObject): if other_text_tag: # note that color of /me may be overwritten in gc_control text_tags.append(other_text_tag) + if text.startswith('/me'): + mark1 = buffer_.create_mark(None, buffer_.get_end_iter(), + left_gravity=True) else: # not status nor /me if gajim.config.get('chat_merge_consecutive_nickname'): if kind != old_kind or self.just_cleared: