From 4723194bcae1db95b89793357a98ecfbb637ed45 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 5 Oct 2009 14:25:47 +0200 Subject: [PATCH] show message subject in chat history. Fixes #5185 --- src/common/logger.py | 4 ++-- src/history_window.py | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/common/logger.py b/src/common/logger.py index ce07d0132..d4af560f1 100644 --- a/src/common/logger.py +++ b/src/common/logger.py @@ -561,7 +561,7 @@ class Logger: return start_of_day def get_conversation_for_date(self, jid, year, month, day, account): - '''returns contact_name, time, kind, show, message + '''returns contact_name, time, kind, show, message, subject for each row in a list of tupples, returns list with empty tupple if we found nothing to meet our demands''' try: @@ -576,7 +576,7 @@ class Logger: last_second_of_day = start_of_day + seconds_in_a_day - 1 self.cur.execute(''' - SELECT contact_name, time, kind, show, message FROM logs + SELECT contact_name, time, kind, show, message, subject FROM logs WHERE (%s) AND time BETWEEN %d AND %d ORDER BY time diff --git a/src/history_window.py b/src/history_window.py index bd20605ae..f3bcfad08 100644 --- a/src/history_window.py +++ b/src/history_window.py @@ -372,9 +372,10 @@ class HistoryWindow: for line in lines: # line[0] is contact_name, line[1] is time of message # line[2] is kind, line[3] is show, line[4] is message - self._add_new_line(line[0], line[1], line[2], line[3], line[4]) + self._add_new_line(line[0], line[1], line[2], line[3], line[4], + line[5]) - def _add_new_line(self, contact_name, tim, kind, show, message): + def _add_new_line(self, contact_name, tim, kind, show, message, subject): '''add a new line in textbuffer''' if not message and kind not in (constants.KIND_STATUS, constants.KIND_GCSTATUS): @@ -457,7 +458,9 @@ class HistoryWindow: format = before_str + contact_name + after_str + ' ' buf.insert_with_tags_by_name(end_iter, format, tag_name) - message = message + '\n' + if subject: + message = _('Subject: %s\n') % subject + message + message += '\n' if tag_msg: self.history_textview.print_real_text(message, [tag_msg], name=contact_name)