HasMessage implemented.

This commit is contained in:
putterman%netscape.com 1999-05-07 00:35:26 +00:00
parent d2cc181656
commit 4208175d48
2 changed files with 27 additions and 0 deletions

View File

@ -574,6 +574,32 @@ nsMsgNewsFolder::GetThreadForMessage(nsIMessage *message, nsIMsgThread **thread)
}
//This needs to be moved up into common base class.
NS_IMETHODIMP
nsMsgNewsFolder::HasMessage(nsIMessage *message, PRBool *hasMessage)
{
if(!hasMessage)
return NS_ERROR_NULL_POINTER;
nsresult rv = GetDatabase();
if(NS_SUCCEEDED(rv))
{
nsCOMPtr<nsIMsgDBHdr> msgDBHdr, msgDBHdrForKey;
nsCOMPtr<nsIDBMessage> dbMessage(do_QueryInterface(message, &rv));
nsMsgKey key;
if(NS_SUCCEEDED(rv))
rv = dbMessage->GetMsgDBHdr(getter_AddRefs(msgDBHdr));
if(NS_SUCCEEDED(rv))
rv = msgDBHdr->GetMessageKey(&key);
if(NS_SUCCEEDED(rv))
rv = mNewsDatabase->ContainsKey(key, hasMessage);
}
return rv;
}
NS_IMETHODIMP nsMsgNewsFolder::BuildFolderURL(char **url)
{
const char *urlScheme = "news:";

View File

@ -74,6 +74,7 @@ public:
NS_IMETHOD GetMessages(nsIEnumerator* *result);
NS_IMETHOD GetThreads(nsIEnumerator** threadEnumerator);
NS_IMETHOD GetThreadForMessage(nsIMessage *message, nsIMsgThread **thread);
NS_IMETHOD HasMessage(nsIMessage *message, PRBool *hasMessage);
NS_IMETHOD CreateSubfolder(const char *folderName);