Bug 231965 LDAP Download User Interface and function broken. r=dmose,sr=bienvenu

This commit is contained in:
bugzilla%standard8.demon.co.uk 2005-10-13 16:13:16 +00:00
Родитель d5bd8fcb00
Коммит 0d60f4a669
2 изменённых файлов: 26 добавлений и 28 удалений

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

@ -44,8 +44,7 @@
#include "nsIAddrBookSession.h"
#include "nsAbBaseCID.h"
#include "nsAbUtils.h"
#include "nsAbMDBCard.h"
#include "nsAbLDAPCard.h"
#include "nsIAbMDBCard.h"
#include "nsAbLDAPReplicationQuery.h"
#include "nsProxiedService.h"
#include "nsCPasswordManager.h"
@ -334,9 +333,24 @@ nsresult nsAbLDAPProcessReplicationData::OnLDAPSearchEntry(nsILDAPMessage *aMess
if(!mReplicationDB || !mDBOpen)
return NS_ERROR_FAILURE;
nsAbLDAPCard card;
nsresult rv = NS_OK;
nsresult rv = mAttrMap->SetCardPropertiesFromLDAPMessage(aMessage, &card);
// Although we would may naturally create an nsIAbLDAPCard here, we don't
// need to as we are writing this straight to the database, so just create
// the database version instead.
nsCOMPtr<nsIAbMDBCard> dbCard(do_CreateInstance(NS_ABMDBCARD_CONTRACTID, &rv));
if(NS_FAILED(rv)) {
Abort();
return rv;
}
nsCOMPtr<nsIAbCard> newCard(do_QueryInterface(dbCard, &rv));
if(NS_FAILED(rv)) {
Abort();
return rv;
}
rv = mAttrMap->SetCardPropertiesFromLDAPMessage(aMessage, newCard);
if (NS_FAILED(rv))
{
NS_WARNING("nsAbLDAPProcessReplicationData::OnLDAPSearchEntry"
@ -359,26 +373,6 @@ nsresult nsAbLDAPProcessReplicationData::OnLDAPSearchEntry(nsILDAPMessage *aMess
printf("\n LDAPReplication :: got card #: %d, name: %s \n", mCount, name.get());
#endif
nsCOMPtr<nsIAbMDBCard> dbCard;
dbCard = do_CreateInstance(NS_ABMDBCARD_CONTRACTID, &rv);
if(NS_FAILED(rv)) {
Abort();
return rv;
}
nsCOMPtr<nsIAbCard> newCard;
newCard = do_QueryInterface(dbCard, &rv);
if(NS_FAILED(rv)) {
Abort();
return rv;
}
rv = newCard->Copy(&card);
if(NS_FAILED(rv)) {
Abort();
return rv;
}
rv = mReplicationDB->CreateNewCardAndAddToDB(newCard, PR_FALSE);
if(NS_FAILED(rv)) {
Abort();

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

@ -139,13 +139,17 @@ NS_IMETHODIMP nsAbLDAPReplicationService::Done(PRBool aSuccess)
}
// This method should query the RootDSE for the changeLog attribute,
// XXX: This method should query the RootDSE for the changeLog attribute,
// if it exists ChangeLog protocol is supported.
PRInt32 nsAbLDAPReplicationService::DecideProtocol()
{
// do the changeLog, it will decide if there is a need to replicate all
// entries or only update existing DB and will do the approprite thing.
return nsIAbLDAPProcessReplicationData::kChangeLogProtocol;
// do the changeLog, it will decide if there is a need to replicate all
// entries or only update existing DB and will do the approprite thing.
//
// XXX: Bug 231965 changed this from kChangeLogProtocol to
// kDefaultDownloadAll because of a problem with ldap replication not
// working correctly. We need to change this back at some stage (bug 311632).
return nsIAbLDAPProcessReplicationData::kDefaultDownloadAll;
}