diff --git a/src/conversation_textview.py b/src/conversation_textview.py index 8d7cce1a6dbae3f12a1803da553f8376411bf005..f7fbbe272f071d7fc7d8aa9f42310d46d1c984da 100644 --- a/src/conversation_textview.py +++ b/src/conversation_textview.py @@ -49,7 +49,7 @@ from common.fuzzyclock import FuzzyClock from htmltextview import HtmlTextView from common.exceptions import GajimGeneralException -from common.exceptions import LatexError +from encodings.punycode import punycode_encode as puny_encode NOT_SHOWN = 0 ALREADY_RECEIVED = 1 @@ -1165,6 +1165,11 @@ class ConversationTextview(gobject.GObject): # convert all names to TextTag all_tags = [(ttt.lookup(t) if isinstance(t, str) else t) for t in all_tags] buffer_.insert_with_tags(end_iter, special_text, *all_tags) + if 'url' in tags: + puny_text = puny_encode(special_text) + if not puny_text.endswith('-'): + end_iter = buffer_.get_end_iter() + buffer_.insert(end_iter, " (%s)" % puny_text) def print_empty_line(self): buffer_ = self.tv.get_buffer()