do not do utf-8 twice; make sure before_/after_time/name possible newlines are taken into account in history window too
This commit is contained in:
parent
313091a771
commit
ac225d4954
|
@ -711,7 +711,6 @@ class ConversationTextview:
|
||||||
# if tim_format comes as unicode because of day_str.
|
# if tim_format comes as unicode because of day_str.
|
||||||
# we convert it to the encoding that we want (and that is utf-8)
|
# we convert it to the encoding that we want (and that is utf-8)
|
||||||
tim_format = helpers.ensure_utf8_string(tim_format)
|
tim_format = helpers.ensure_utf8_string(tim_format)
|
||||||
tim_format = tim_format.encode('utf-8')
|
|
||||||
buffer.insert_with_tags_by_name(end_iter, tim_format + ' ',
|
buffer.insert_with_tags_by_name(end_iter, tim_format + ' ',
|
||||||
*other_tags_for_time)
|
*other_tags_for_time)
|
||||||
elif current_print_time == 'sometimes' and kind != 'info':
|
elif current_print_time == 'sometimes' and kind != 'info':
|
||||||
|
|
|
@ -210,7 +210,9 @@ class HistoryWindow:
|
||||||
|
|
||||||
if gajim.config.get('print_time') == 'always':
|
if gajim.config.get('print_time') == 'always':
|
||||||
before_str = gajim.config.get('before_time')
|
before_str = gajim.config.get('before_time')
|
||||||
|
before_str = helpers.from_one_line(before_str)
|
||||||
after_str = gajim.config.get('after_time')
|
after_str = gajim.config.get('after_time')
|
||||||
|
after_str = helpers.from_one_line(after_str)
|
||||||
format = before_str + '%X' + after_str + ' '
|
format = before_str + '%X' + after_str + ' '
|
||||||
tim = time.strftime(format, time.localtime(float(tim)))
|
tim = time.strftime(format, time.localtime(float(tim)))
|
||||||
buf.insert(end_iter, tim) # add time
|
buf.insert(end_iter, tim) # add time
|
||||||
|
|
Loading…
Reference in New Issue