show message subject in chat history. Fixes #5185

This commit is contained in:
Yann Leboulanger 2009-10-05 14:25:47 +02:00
parent ea6c062b9a
commit 4723194bca
2 changed files with 8 additions and 5 deletions

View File

@ -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

View File

@ -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)