print subject first

This commit is contained in:
Nikos Kouremenos 2005-07-08 00:53:50 +00:00
parent 4fe2414534
commit e902eaed7d
1 changed files with 7 additions and 6 deletions

View File

@ -832,6 +832,7 @@ class Chat:
def print_conversation_line(self, text, jid, kind, name, tim, def print_conversation_line(self, text, jid, kind, name, tim,
other_tags_for_name = [], other_tags_for_time = [], other_tags_for_name = [], other_tags_for_time = [],
other_tags_for_text = [], count_as_new = True, subject = None): other_tags_for_text = [], count_as_new = True, subject = None):
'''' prints 'chat' type messages '''
textview = self.xmls[jid].get_widget('conversation_textview') textview = self.xmls[jid].get_widget('conversation_textview')
buffer = textview.get_buffer() buffer = textview.get_buffer()
buffer.begin_user_action() buffer.begin_user_action()
@ -886,15 +887,15 @@ class Chat:
# detect urls formatting and if the user has it on emoticons # detect urls formatting and if the user has it on emoticons
index = self.detect_and_print_special_text(text, jid, text_tags) index = self.detect_and_print_special_text(text, jid, text_tags)
if subject: # if we have subject, show it too!
subject = _('Subject: %s\n') % subject
end_iter = buffer.get_end_iter()
buffer.insert(end_iter, subject)
# add the rest of text located in the index and after # add the rest of text located in the index and after
end_iter = buffer.get_end_iter() end_iter = buffer.get_end_iter()
buffer.insert_with_tags_by_name(end_iter, text[index:], *text_tags) buffer.insert_with_tags_by_name(end_iter, text[index:], *text_tags)
if subject: # if we have subject, send it too!
subject = '\n' + _('Subject: %s') % subject
end_iter = buffer.get_end_iter()
buffer.insert_with_tags_by_name(end_iter, subject, *text_tags)
#scroll to the end of the textview #scroll to the end of the textview
end = False end = False
if at_the_end or kind == 'outgoing': if at_the_end or kind == 'outgoing':