migrate the biff prefs for imap servers

This commit is contained in:
sspitzer%netscape.com 1999-07-14 15:03:38 +00:00
Родитель 23148c5af1
Коммит fc62d46708
1 изменённых файлов: 20 добавлений и 2 удалений

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

@ -1112,6 +1112,9 @@ nsresult
nsMsgAccountManager::MigrateImapAccount(nsIMsgIdentity *identity, const char *hostname, PRInt32 accountNum)
{
nsresult rv;
PRInt32 oldint;
PRBool oldbool;
if (!hostname) return NS_ERROR_NULL_POINTER;
if (accountNum < 1) return NS_ERROR_FAILURE;
@ -1164,7 +1167,7 @@ nsMsgAccountManager::MigrateImapAccount(nsIMsgIdentity *identity, const char *ho
server->SetType("imap");
server->SetHostName((char *)hostname);
char prefName[1024];
PR_snprintf(prefName, 1024, "mail.imap.server.%s.userName",hostname);
rv = m_prefs->CopyCharPref(prefName, &oldstr);
@ -1173,7 +1176,9 @@ nsMsgAccountManager::MigrateImapAccount(nsIMsgIdentity *identity, const char *ho
PR_FREEIF(oldstr);
oldstr = nsnull;
}
// upgrade the password
// this won't work, since 5.0 is crypto free.
PR_snprintf(prefName, 1024, "mail.imap.server.%s.password",hostname);
rv = m_prefs->CopyCharPref(prefName, &oldstr);
if (NS_SUCCEEDED(rv)) {
@ -1181,6 +1186,19 @@ nsMsgAccountManager::MigrateImapAccount(nsIMsgIdentity *identity, const char *ho
PR_FREEIF(oldstr);
oldstr = nsnull;
}
// upgrade the biff prefs
PR_snprintf(prefName, 1024, "mail.imap.server.%s.check_new_mail",hostname);
rv = m_prefs->GetBoolPref(prefName, &oldbool);
if (NS_SUCCEEDED(rv)) {
server->SetDoBiff(oldbool);
}
PR_snprintf(prefName, 1024, "mail.imap.server.%s.check_time",hostname);
rv = m_prefs->GetIntPref(prefName, &oldint);
if (NS_SUCCEEDED(rv)) {
server->SetBiffMinutes(oldint);
}
// create the directory structure for this pop account
// under <profile dir>/Mail/<hostname>