don't need to do all this extra work - work is done in base class

This commit is contained in:
alecf%netscape.com 2000-05-01 22:58:42 +00:00
Родитель 76d3069e09
Коммит fbd679af8a
2 изменённых файлов: 0 добавлений и 49 удалений

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

@ -46,16 +46,6 @@ nsLocalMessage::~nsLocalMessage(void)
NS_IMPL_ISUPPORTS_INHERITED(nsLocalMessage, nsMessage, nsIDBMessage)
NS_IMETHODIMP nsLocalMessage::GetMsgFolder(nsIMsgFolder **folder)
{
nsresult rv;
rv = nsMessage::GetMsgFolder(folder);
if (NS_FAILED(rv))
rv = GetFolderFromURI(folder);
return rv;
}
NS_IMETHODIMP nsLocalMessage::GetMessageType(PRUint32 *aMessageType)
{
if(!aMessageType)
@ -65,39 +55,3 @@ NS_IMETHODIMP nsLocalMessage::GetMessageType(PRUint32 *aMessageType)
return NS_OK;
}
nsresult nsLocalMessage::GetFolderFromURI(nsIMsgFolder **folder)
{
nsresult rv;
nsXPIDLCString uri;
nsCOMPtr<nsIRDFResource> resource;
if(NS_SUCCEEDED( rv = QueryInterface(NS_GET_IID(nsIRDFResource), getter_AddRefs(resource))))
{
resource->GetValue( getter_Copies(uri) );
nsCAutoString messageFolderURIStr;
nsMsgKey key;
nsParseLocalMessageURI(uri, messageFolderURIStr, &key);
nsCAutoString folderOnly, folderURIStr;
if (messageFolderURIStr.Find(kMailboxMessageRootURI) != ((PRInt32)-1))
{
messageFolderURIStr.Right(folderOnly, messageFolderURIStr.Length() -nsCRT::strlen(kMailboxMessageRootURI));
folderURIStr = kMailboxRootURI;
folderURIStr+= folderOnly;
nsCOMPtr<nsIRDFResource> folderResource;
const char *folderURI = folderURIStr.GetBuffer();
NS_WITH_SERVICE(nsIRDFService, rdfService, kRDFServiceCID, &rv);
if (NS_SUCCEEDED(rv)) // always check this before proceeding
{
rv = rdfService->GetResource(folderURI, getter_AddRefs(folderResource));
if(NS_SUCCEEDED(rv))
{
rv = NS_SUCCEEDED(folderResource->QueryInterface(NS_GET_IID(nsIMsgFolder), (void**)folder));
}
}
}
}
return rv;
}

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

@ -38,12 +38,9 @@ public:
virtual ~nsLocalMessage(void);
NS_DECL_ISUPPORTS_INHERITED
NS_IMETHOD GetMsgFolder(nsIMsgFolder **folder);
NS_IMETHOD GetMessageType(PRUint32 *aMessageType);
protected:
nsresult GetFolderFromURI(nsIMsgFolder **folder);
};
#endif //nsLocalMessage_h__