changeset 9da845138617 in /home/hg/repos/gajim
branches:
details:http://hg.gajim.org/gajim?cmd=changeset;node=9da845138617
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 1e52119ce230 -r 9da845138617 src/chat_control.py
--- a/src/chat_control.py Tue Aug 13 22:29:17 2013 +0400
+++ b/src/chat_control.py Tue Aug 13 21:18:44 2013 +0200
@@ -1359,8 +1359,8 @@
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 @@
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 1e52119ce230 -r 9da845138617 src/conversation_textview.py
--- a/src/conversation_textview.py Tue Aug 13 22:29:17 2013 +0400
+++ b/src/conversation_textview.py Tue Aug 13 21:18:44 2013 +0200
@@ -486,7 +486,10 @@
i2 = buffer_.get_iter_at_mark(m2)
txt = buffer_.get_text(i1, i2)
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
@@ -1333,6 +1336,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