зеркало из https://github.com/mozilla/pjs.git
instead of getting the first server from the account manager, get the first one named news.mozilla.org (eventually we have to figure out our own hostname from the URI)
This commit is contained in:
Родитель
02008476e9
Коммит
8e3eb389aa
|
@ -41,13 +41,23 @@ nsGetNewsRoot(nsFileSpec &result)
|
|||
if (gNewsRoot == nsnull) {
|
||||
NS_WITH_SERVICE(nsIMsgMailSession, session, kMsgMailSessionCID, &rv);
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIMsgIncomingServer> server;
|
||||
rv = session->GetCurrentServer(getter_AddRefs(server));
|
||||
nsCOMPtr<nsIMsgAccountManager> accountManager;
|
||||
rv = session->GetAccountManager(getter_AddRefs(accountManager));
|
||||
|
||||
if (NS_SUCCEEDED(rv))
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsISupportsArray> servers;
|
||||
rv = accountManager->FindServersByHostname("news.mozilla.org",
|
||||
nsINntpIncomingServer::GetIID(),
|
||||
getter_AddRefs(servers));
|
||||
|
||||
if (NS_SUCCEEDED(rv) && servers->Count() > 0) {
|
||||
nsCOMPtr<nsIMsgIncomingServer> server;
|
||||
server = do_QueryInterface(servers->ElementAt(0));
|
||||
|
||||
if (server)
|
||||
rv = server->GetLocalPath(&gNewsRoot);
|
||||
}
|
||||
}
|
||||
} /* if (gNewsRoot == nsnull) .. */
|
||||
|
||||
result = gNewsRoot;
|
||||
|
|
Загрузка…
Ссылка в новой задаче