changeset 96d11fb9663e in /home/hg/repos/gajim
branches: gtk3
details:http://hg.gajim.org/gajim?cmd=changeset;node=96d11fb9663e
description: print correctly when we correct a /me message. Fixes #7400
diffstat:
src/chat_control.py | 12 ++++++------
src/conversation_textview.py | 8 +++++++-
2 files changed, 13 insertions(+), 7 deletions(-)
diffs (58 lines):
diff -r cd2203a09023 -r 96d11fb9663e src/chat_control.py
--- a/src/chat_control.py Tue Aug 13 18:27:17 2013 +0200
+++ b/src/chat_control.py Tue Aug 13 21:18:44 2013 +0200
@@ -1394,8 +1394,8 @@
end_iter = msg_buf.get_end_iter()
self.orig_msg = msg_buf.get_text(start_iter, end_iter, False)
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
context = self.msg_textview.get_style_context()
state = Gtk.StateFlags.NORMAL
@@ -3032,14 +3032,14 @@
xhtml = None
if row[2].startswith('<body '):
xhtml = row[2]
+ if row[2].startswith('/me ') or row[2].startswith('/me\n'):
+ local_old_kind = None
+ else:
+ local_old_kind = kind
ChatControlBase.print_conversation_line(self, row[2], kind, name,
tim, small_attr, small_attr + ['restored_message'],
small_attr + ['restored_message'], False,
old_kind=local_old_kind, xhtml=xhtml)
- if row[2].startswith('/me ') or row[2].startswith('/me\n'):
- local_old_kind = None
- else:
- local_old_kind = kind
if len(rows):
self.conv_textview.print_empty_line()
diff -r cd2203a09023 -r 96d11fb9663e src/conversation_textview.py
--- a/src/conversation_textview.py Tue Aug 13 18:27:17 2013 +0200
+++ b/src/conversation_textview.py Tue Aug 13 21:18:44 2013 +0200
@@ -491,7 +491,10 @@
i2 = buffer_.get_iter_at_mark(m2)
txt = buffer_.get_text(i1, i2, True)
buffer_.delete(i1, i2)
- i2 = self.print_real_text(message, text_tags=['outgoingtxt'],
name=name,
+ tag = 'outgoingtxt'
+ if message.startswith('/me'):
+ tag = 'outgoing'
+ i2 = self.print_real_text(message, text_tags=[tag], name=name,
xhtml=xhtml, iter_=i1)
tt_txt = _('<b>Message was corrected. Last message was:</b>\n %s') % \
old_txt
@@ -1353,6 +1356,9 @@
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:
_______________________________________________
Commits mailing list
[email protected]
http://lists.gajim.org/cgi-bin/listinfo/commits