Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsCopyMessageStreamListener.cpp File Reference
#include "nsCopyMessageStreamListener.h"
#include "nsIMsgMailNewsUrl.h"
#include "nsIMailboxUrl.h"
#include "nsIMsgHdr.h"
#include "nsIRDFService.h"
#include "nsIRDFNode.h"
#include "nsRDFCID.h"
#include "nsIMsgImapMailFolder.h"
#include "nsXPIDLString.h"
#include "nsIMsgMessageService.h"
#include "nsMsgUtils.h"
#include "netCore.h"

Go to the source code of this file.

Functions

static
NS_INTERFACE_MAP_END_THREADSAFE
nsresult 
GetMessage (nsIURI *aURL, nsIMsgDBHdr **message)

Function Documentation

static NS_INTERFACE_MAP_END_THREADSAFE nsresult GetMessage ( nsIURI aURL,
nsIMsgDBHdr **  message 
) [static]

Definition at line 62 of file nsCopyMessageStreamListener.cpp.

{
  NS_ENSURE_ARG_POINTER(message);

       nsCOMPtr<nsIMsgMessageUrl> uriURL;
       nsresult rv;

       //Need to get message we are about to copy
       uriURL = do_QueryInterface(aURL, &rv);
       if(NS_FAILED(rv))
              return rv;

  // get the uri.  first try and use the original message spec
  // if that fails, use the spec of nsIURI that we're called with
  nsXPIDLCString uri;
  rv = uriURL->GetOriginalSpec(getter_Copies(uri));
  if (NS_FAILED(rv) || uri.IsEmpty()) {
    rv = uriURL->GetUri(getter_Copies(uri));
         NS_ENSURE_SUCCESS(rv,rv);
  }

  nsCOMPtr <nsIMsgMessageService> msgMessageService;
  rv = GetMessageServiceFromURI(uri, getter_AddRefs(msgMessageService));
  NS_ENSURE_SUCCESS(rv,rv);
  if (!msgMessageService) 
    return NS_ERROR_FAILURE;

  rv = msgMessageService->MessageURIToMsgHdr(uri.get(), message);
  return rv; 
}

Here is the call graph for this function: