look if we have unread / recent messages AFTER we get the status message (we can also do it before AND after ... comments ?)
This commit is contained in:
parent
e2012ca370
commit
156c81846b
|
@ -1032,6 +1032,15 @@ class Roster_window:
|
|||
|
||||
def on_quit_menuitem_activate(self, widget):
|
||||
accounts = gajim.connections.keys()
|
||||
get_msg = False
|
||||
for acct in accounts:
|
||||
if gajim.connections[acct].connected:
|
||||
get_msg = True
|
||||
break
|
||||
if get_msg:
|
||||
message = self.get_status_message('offline')
|
||||
if message == -1:
|
||||
return
|
||||
# check if we have unread or recent mesages
|
||||
unread = False
|
||||
recent = False
|
||||
|
@ -1057,19 +1066,11 @@ class Roster_window:
|
|||
dialog = dialogs.Confirmation_dialog(_('You have unread messages.\nAre you sure you want to quit Gajim?'))
|
||||
if dialog.get_response() != gtk.RESPONSE_YES:
|
||||
return
|
||||
#FIXME: do we keep that ?
|
||||
if recent:
|
||||
dialog = dialogs.Confirmation_dialog(_('You received a message in the last two seconds.\nAre you sure you want to quit Gajim?'))
|
||||
if dialog.get_response() != gtk.RESPONSE_YES:
|
||||
return
|
||||
get_msg = False
|
||||
for acct in accounts:
|
||||
if gajim.connections[acct].connected:
|
||||
get_msg = True
|
||||
break
|
||||
if get_msg:
|
||||
message = self.get_status_message('offline')
|
||||
if message == -1:
|
||||
return
|
||||
for acct in accounts:
|
||||
if gajim.connections[acct].connected:
|
||||
self.send_status(acct, 'offline', message)
|
||||
|
|
Loading…
Reference in New Issue