[lumirayz and mrDoctorWho] Ignore /me when determining direction_mark. Fixes #7414

This commit is contained in:
Yann Leboulanger 2013-09-03 18:19:46 +02:00
parent 61e685ffd0
commit 8d9d518b64
1 changed files with 6 additions and 4 deletions

View File

@ -1289,6 +1289,9 @@ class ConversationTextview(gobject.GObject):
# We don't have tim for outgoing messages... # We don't have tim for outgoing messages...
tim = time.localtime() tim = time.localtime()
current_print_time = gajim.config.get('print_time') current_print_time = gajim.config.get('print_time')
if text.startswith('/me '):
direction_mark = i18n.paragraph_direction_mark(unicode(text[3:]))
else:
direction_mark = i18n.paragraph_direction_mark(unicode(text)) direction_mark = i18n.paragraph_direction_mark(unicode(text))
# don't apply direction mark if it's status message # don't apply direction mark if it's status message
if kind == 'status': if kind == 'status':
@ -1296,7 +1299,7 @@ class ConversationTextview(gobject.GObject):
if current_print_time == 'always' and kind != 'info' and not simple: if current_print_time == 'always' and kind != 'info' and not simple:
timestamp_str = self.get_time_to_show(tim, direction_mark) timestamp_str = self.get_time_to_show(tim, direction_mark)
timestamp = time.strftime(timestamp_str, tim) timestamp = time.strftime(timestamp_str, tim)
timestamp = direction_mark + timestamp timestamp = direction_mark + timestamp + direction_mark
buffer_.insert_with_tags_by_name(end_iter, timestamp, buffer_.insert_with_tags_by_name(end_iter, timestamp,
*other_tags_for_time) *other_tags_for_time)
elif current_print_time == 'sometimes' and kind != 'info' and not simple: elif current_print_time == 'sometimes' and kind != 'info' and not simple:
@ -1427,8 +1430,7 @@ class ConversationTextview(gobject.GObject):
before_str = helpers.from_one_line(before_str) before_str = helpers.from_one_line(before_str)
after_str = gajim.config.get('after_nickname') after_str = gajim.config.get('after_nickname')
after_str = helpers.from_one_line(after_str) after_str = helpers.from_one_line(after_str)
format_ = direction_mark + before_str + name + direction_mark + \ format_ = before_str + name + direction_mark + after_str + ' '
after_str + ' '
buffer_.insert_with_tags_by_name(end_iter, format_, *name_tags) buffer_.insert_with_tags_by_name(end_iter, format_, *name_tags)
def print_subject(self, subject, iter_=None): def print_subject(self, subject, iter_=None):