don;t ask for close if last message was shown
from trayicon or roster (#276)
This commit is contained in:
parent
9fc1516522
commit
c1be7e955d
|
@ -882,7 +882,10 @@ class Chat:
|
||||||
|
|
||||||
if buffer.get_char_count() > 0:
|
if buffer.get_char_count() > 0:
|
||||||
buffer.insert(end_iter, '\n')
|
buffer.insert(end_iter, '\n')
|
||||||
|
update_time = True
|
||||||
|
if kind == 'incoming_queue':
|
||||||
|
kind = 'incoming'
|
||||||
|
update_time = False
|
||||||
# print the time stamp
|
# print the time stamp
|
||||||
if gajim.config.get('print_time') == 'always':
|
if gajim.config.get('print_time') == 'always':
|
||||||
if not tim:
|
if not tim:
|
||||||
|
@ -946,10 +949,8 @@ class Chat:
|
||||||
|
|
||||||
if not count_as_new:
|
if not count_as_new:
|
||||||
return
|
return
|
||||||
|
if kind == 'incoming' and update_time:
|
||||||
if kind == 'incoming':
|
|
||||||
gajim.last_message_time[self.account][jid] = time.time()
|
gajim.last_message_time[self.account][jid] = time.time()
|
||||||
|
|
||||||
if (jid != self.get_active_jid() or \
|
if (jid != self.get_active_jid() or \
|
||||||
not self.window.is_active() or \
|
not self.window.is_active() or \
|
||||||
not end) and kind == 'incoming':
|
not end) and kind == 'incoming':
|
||||||
|
|
|
@ -568,7 +568,7 @@ class TabbedChatWindow(chat.Chat):
|
||||||
user = self.contacts[jid]
|
user = self.contacts[jid]
|
||||||
for event in l:
|
for event in l:
|
||||||
self.print_conversation(event[0], jid, tim = event[1],
|
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.nb_unread -= 1
|
||||||
self.plugin.roster.show_title()
|
self.plugin.roster.show_title()
|
||||||
del gajim.awaiting_messages[self.account][jid]
|
del gajim.awaiting_messages[self.account][jid]
|
||||||
|
@ -586,6 +586,7 @@ class TabbedChatWindow(chat.Chat):
|
||||||
"""Print a line in the conversation:
|
"""Print a line in the conversation:
|
||||||
if contact is set to status: it's a status message
|
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 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"""
|
if contact is not set: it's an incomming message"""
|
||||||
user = self.contacts[jid]
|
user = self.contacts[jid]
|
||||||
if contact == 'status':
|
if contact == 'status':
|
||||||
|
@ -604,13 +605,15 @@ class TabbedChatWindow(chat.Chat):
|
||||||
'status', '', tim)
|
'status', '', tim)
|
||||||
ec.remove(jid)
|
ec.remove(jid)
|
||||||
self.xmls[jid].get_widget('gpg_togglebutton').set_active(encrypted)
|
self.xmls[jid].get_widget('gpg_togglebutton').set_active(encrypted)
|
||||||
if contact:
|
if not contact:
|
||||||
kind = 'outgoing'
|
|
||||||
name = gajim.nicks[self.account]
|
|
||||||
else:
|
|
||||||
kind = 'incoming'
|
kind = 'incoming'
|
||||||
name = user.name
|
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,
|
chat.Chat.print_conversation_line(self, text, jid, kind, name, tim,
|
||||||
subject = subject)
|
subject = subject)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue