Skip to content
Snippets Groups Projects
Commit c1be7e95 authored by dkirov's avatar dkirov
Browse files

don;t ask for close if last message was shown

from trayicon or roster (#276)
parent 9fc15165
No related branches found
No related tags found
No related merge requests found
......@@ -882,7 +882,10 @@ def print_conversation_line(self, text, jid, kind, name, tim,
if buffer.get_char_count() > 0:
buffer.insert(end_iter, '\n')
update_time = True
if kind == 'incoming_queue':
kind = 'incoming'
update_time = False
# print the time stamp
if gajim.config.get('print_time') == 'always':
if not tim:
......@@ -946,10 +949,8 @@ def print_conversation_line(self, text, jid, kind, name, tim,
if not count_as_new:
return
if kind == 'incoming':
if kind == 'incoming' and update_time:
gajim.last_message_time[self.account][jid] = time.time()
if (jid != self.get_active_jid() or \
not self.window.is_active() or \
not end) and kind == 'incoming':
......
......@@ -568,7 +568,7 @@ def read_queue(self, jid):
user = self.contacts[jid]
for event in l:
self.print_conversation(event[0], jid, tim = event[1],
encrypted = event[2])
encrypted = event[2], contact='print_queue')
self.plugin.roster.nb_unread -= 1
self.plugin.roster.show_title()
del gajim.awaiting_messages[self.account][jid]
......@@ -586,6 +586,7 @@ def print_conversation(self, text, jid, contact = '', tim = None,
"""Print a line in the conversation:
if contact is set to status: it's a status message
if contact is set to another value: it's an outgoing message
if contact is set to print_queue: it is incomming from queue
if contact is not set: it's an incomming message"""
user = self.contacts[jid]
if contact == 'status':
......@@ -604,13 +605,15 @@ def print_conversation(self, text, jid, contact = '', tim = None,
'status', '', tim)
ec.remove(jid)
self.xmls[jid].get_widget('gpg_togglebutton').set_active(encrypted)
if contact:
kind = 'outgoing'
name = gajim.nicks[self.account]
else:
if not contact:
kind = 'incoming'
name = user.name
elif contact == 'print_queue': # incoming message, but do not update time
kind = 'incoming_queue'
name = user.name
else:
kind = 'outgoing'
name = gajim.nicks[self.account]
chat.Chat.print_conversation_line(self, text, jid, kind, name, tim,
subject = subject)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment