Bug70532 Import Settings and "Leave Messages on Server" is not selected, r=ducarroz, sr=mscott

This commit is contained in:
chuang%netscape.com 2001-05-02 23:41:47 +00:00
Родитель 39bb61b899
Коммит 082a0d0fe6
4 изменённых файлов: 48 добавлений и 9 удалений

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

@ -35,6 +35,7 @@
#include "nsSpecialSystemDirectory.h"
#include "nsEudoraStringBundle.h"
#include "nsEudoraImport.h"
#include "nsIPop3IncomingServer.h"
#include "EudoraDebugLog.h"
@ -498,6 +499,14 @@ nsresult nsEudoraMac::FindTOCFile( nsIFileSpec *pMailFile, nsIFileSpec **ppTOCFi
#define kFullNameStr 4
#define kLeaveOnServerStr 5
// resource IDs
#define kSmtpServerID 4
#define kEmailAddressID 3
#define kReturnAddressID 5
#define kFullNameID 77
#define kLeaveMailOnServerID 18
PRBool nsEudoraMac::GetSettingsFromResource( nsIFileSpec *pSettings, short resId, nsCString **pStrs, PRBool *pIMAP)
{
*pIMAP = PR_FALSE;
@ -523,11 +532,11 @@ PRBool nsEudoraMac::GetSettingsFromResource( nsIFileSpec *pSettings, short resId
pStr[i] = (StringPtr) new PRUint8[256];
(pStr[i])[0] = 0;
}
GetIndString( pStr[0], resId /* 1000 */, 4);
GetIndString( pStr[1], resId, 3);
GetIndString( pStr[2], resId, 5);
GetIndString( pStr[3], resId, 77);
GetIndString( pStr[4], resId, 18);
GetIndString( pStr[0], resId /* 1000 */, kSmtpServerID);
GetIndString( pStr[1], resId, kEmailAddressID); // user name@pop server
GetIndString( pStr[2], resId, kReturnAddressID);
GetIndString( pStr[3], resId, kFullNameID);
GetIndString( pStr[4], resId, kLeaveMailOnServerID);
CloseResFile( resFile);
theStr = pStr[0];
@ -711,7 +720,11 @@ PRBool nsEudoraMac::BuildPOPAccount( nsIMsgAccountManager *accMgr, nsCString **p
IMPORT_LOG0( "Created a new account and set the incoming server to the POP3 server.\n");
// Fiddle with the identities
nsCOMPtr<nsIPop3IncomingServer> pop3Server = do_QueryInterface(in, &rv);
NS_ENSURE_SUCCESS(rv,rv);
pop3Server->SetLeaveMessagesOnServer(*pStrs[kLeaveOnServerStr])[0] == 'Y' ? PR_TRUE : PR_FALSE);
// Fiddle with the identities
SetIdentities( accMgr, account, pStrs);
result = PR_TRUE;
if (ppAccount)

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

@ -24,6 +24,7 @@
#include "nsIServiceManager.h"
#include "nsIMsgAccountManager.h"
#include "nsIMsgAccount.h"
#include "nsIPop3IncomingServer.h"
#include "nsMsgBaseCID.h"
#include "nsMsgCompCID.h"
#include "nsISmtpService.h"
@ -751,9 +752,14 @@ PRBool nsEudoraWin32::BuildPOPAccount( nsIMsgAccountManager *accMgr, const char
rv = accMgr->CreateAccount( getter_AddRefs( account));
if (NS_SUCCEEDED( rv) && account) {
rv = account->SetIncomingServer( in);
IMPORT_LOG0( "Created a new account and set the incoming server to the POP3 server.\n");
nsCOMPtr<nsIPop3IncomingServer> pop3Server = do_QueryInterface(in, &rv);
NS_ENSURE_SUCCESS(rv,rv);
UINT valInt = ::GetPrivateProfileInt(pSection, "LeaveMailOnServer", 0, pIni);
pop3Server->SetLeaveMessagesOnServer(valInt ? PR_TRUE : PR_FALSE);
// Fiddle with the identities
SetIdentities( accMgr, account, pSection, pIni, valBuff);
result = PR_TRUE;

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

@ -44,6 +44,7 @@
#include "nsISmtpServer.h"
#include "nsOEStringBundle.h"
#include "OEDebugLog.h"
#include "nsIPop3IncomingServer.h"
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
@ -417,7 +418,16 @@ PRBool OESettings::DoPOP3Server( nsIMsgAccountManager *pMgr, HKEY hKey, char *pS
IMPORT_LOG0( "Created a new account and set the incoming server to the POP3 server.\n");
// Fiddle with the identities
nsCOMPtr<nsIPop3IncomingServer> pop3Server = do_QueryInterface(in, &rv);
NS_ENSURE_SUCCESS(rv,rv);
BYTE *pLeaveOnServer = nsOERegUtil::GetValueBytes( hKey, "Leave Mail On Server");
if (pLeaveOnServer)
{
pop3Server->SetLeaveMessagesOnServer(*pLeaveOnServer == 1 ? PR_TRUE : PR_FALSE);
nsOERegUtil::FreeValueBytes(pLeaveOnServer);
}
// Fiddle with the identities
SetIdentities( pMgr, account, hKey);
result = PR_TRUE;
if (ppAccount)

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

@ -44,6 +44,7 @@
#include "nsISmtpServer.h"
#include "nsOutlookStringBundle.h"
#include "OutlookDebugLog.h"
#include "nsIPop3IncomingServer.h"
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
@ -374,7 +375,16 @@ PRBool OutlookSettings::DoPOP3Server( nsIMsgAccountManager *pMgr, HKEY hKey, cha
IMPORT_LOG0( "Created a new account and set the incoming server to the POP3 server.\n");
// Fiddle with the identities
nsCOMPtr<nsIPop3IncomingServer> pop3Server = do_QueryInterface(in, &rv);
NS_ENSURE_SUCCESS(rv,rv);
BYTE *pLeaveOnServer = nsOutlookRegUtil::GetValueBytes( hKey, "Leave Mail On Server");
if (pLeaveOnServer)
{
pop3Server->SetLeaveMessagesOnServer(*pLeaveOnServer == 1 ? PR_TRUE : PR_FALSE);
nsOutlookRegUtil::FreeValueBytes(pLeaveOnServer);
}
// Fiddle with the identities
SetIdentities( pMgr, account, hKey);
result = PR_TRUE;
if (ppAccount)