bug52368 Deleted entries in PAB shows up in mailing list. r=putterman,sr=alecf

This commit is contained in:
chuang%netscape.com 2000-10-04 20:36:46 +00:00
parent 71429f3911
commit 52edc879e8
2 changed files with 35 additions and 2 deletions

View File

@ -363,7 +363,7 @@ function awAppendNewRow(setFocus)
if ( body && treeitem1 )
{
newNode = awCopyNode(treeitem1, body, 0);
var newNode = awCopyNode(treeitem1, body, 0);
top.MAX_RECIPIENTS++;
var input = newNode.getElementsByTagName(awInputElementName());
@ -487,7 +487,7 @@ function _awSetFocus()
var tree = document.getElementById('addressListTree');
try
{
theNewRow = awGetTreeRow(top.awRow);
var theNewRow = awGetTreeRow(top.awRow);
//temporary patch for bug 26344
// awFinishCopyNode(theNewRow);

View File

@ -1794,6 +1794,39 @@ nsresult nsAddrDatabase::AddListCardColumnsToRow
NotifyCardEntryChange(AB_NotifyInserted, newCard, NULL);
}
else if (pCardRow)
{
//existing card, get the card ptr
mdbOid cardOid;
char* cardURI = nsnull;
char* file = nsnull;
if (NS_SUCCEEDED(pCardRow->GetOid(GetEnv(), &cardOid)))
{
file = m_dbName.GetLeafName();
if (file)
{
cardURI = PR_smprintf("%s%s/Card%ld", kCardDataSourceRoot, file, cardOid.mOid_Id);
NS_WITH_SERVICE(nsIRDFService, rdfService, kRDFServiceCID, &err);
if (NS_SUCCEEDED(err) && cardURI)
{
nsCOMPtr<nsIRDFResource> cardResource;
err = rdfService->GetResource(cardURI, getter_AddRefs(cardResource));
if (NS_SUCCEEDED(err))
{
nsCOMPtr<nsIAbCard> personCard = do_QueryInterface(cardResource);
if (personCard)
{
*pNewCard = personCard;
NS_IF_ADDREF(*pNewCard);
}
}
PR_smprintf_free(cardURI);
}
nsCRT::free(file);
}
}
}
PR_FREEIF(pUTF8Email);
if (!pCardRow)