Bug 273496: pressing 'get new messages' shouldn't ask to send unsent messages when going online, patch by Magnus Melin <mkmelin+mozilla@iki.fi>, r=mscott

This commit is contained in:
gavin%gavinsharp.com 2007-01-09 19:53:35 +00:00
Родитель 9525302ffb
Коммит 8b2527203e
2 изменённых файлов: 10 добавлений и 8 удалений

Просмотреть файл

@ -207,15 +207,17 @@ var MailOfflineMgr = {
*/
shouldSendUnsentMessages: function()
{
// if we are online already, and we have unsent messages, then honor the
// offline.send.unsent_messages pref.
if (this.isOnline() && this.haveUnsentMessages())
var sendUnsentWhenGoingOnlinePref = gPrefBranch.getIntPref("offline.send.unsent_messages");
if(sendUnsentWhenGoingOnlinePref == 2) // never send
return false;
// if we we have unsent messages, then honor the offline.send.unsent_messages pref.
else if (this.haveUnsentMessages())
{
var sendUnsentWhenGoingOnlinePref = gPrefBranch.getIntPref("offline.send.unsent_messages");
if ((sendUnsentWhenGoingOnlinePref == 0 && this.confirmSendUnsentMessages()) || sendUnsentWhenGoingOnlinePref == 1)
if ((sendUnsentWhenGoingOnlinePref == 0 && this.confirmSendUnsentMessages())
|| sendUnsentWhenGoingOnlinePref == 1)
return true;
}
return false;
},
@ -259,7 +261,7 @@ var MailOfflineMgr = {
this.offlineBundle.getString('getMessagesOfflineWindowTitle1'),
this.offlineBundle.getString('getMessagesOfflineLabel1'));
if (goOnline)
this.offlineManager.goOnline(this.haveUnsentMessages() && this.confirmSendUnsentMessages(),
this.offlineManager.goOnline(this.shouldSendUnsentMessages(),
false /* playbackOfflineImapOperations */, msgWindow);
return goOnline;
},

Просмотреть файл

@ -1029,7 +1029,7 @@ function loadStartFolder(initialUri)
MsgGetMessagesForAllServers(defaultServer);
// if appropriate, send unsent messages. This may end up prompting the user
if (MailOfflineMgr.shouldSendUnsentMessages())
if (MailOfflineMgr.isOnline() && MailOfflineMgr.shouldSendUnsentMessages())
SendUnsentMessages();
}