ipsservices/ipssosplugin/src/ipsplgcreateforwardmessageoperation.cpp
changeset 23 2dc6caa42ec3
parent 20 ecc8def7944a
equal deleted inserted replaced
20:ecc8def7944a 23:2dc6caa42ec3
    16 */
    16 */
    17 
    17 
    18 // <qmail>
    18 // <qmail>
    19 
    19 
    20 // INCLUDE FILES
    20 // INCLUDE FILES
    21 
       
    22 #include "emailtrace.h"
    21 #include "emailtrace.h"
    23 #include "ipsplgheaders.h"
    22 #include "ipsplgheaders.h"
    24 
    23 
    25 // LOCAL CONSTANTS AND MACROS
    24 // <qmail> removed comment
    26 
    25 
    27 // ================= MEMBER FUNCTIONS =======================
    26 // ================= MEMBER FUNCTIONS =======================
    28 
    27 
    29 // ----------------------------------------------------------------------------
    28 // ----------------------------------------------------------------------------
    30 // CIpsPlgCreateForwardMessageOperation::CIpsPlgCreateForwardMessageOperation
    29 // CIpsPlgCreateForwardMessageOperation::CIpsPlgCreateForwardMessageOperation
    31 // ----------------------------------------------------------------------------
    30 // ----------------------------------------------------------------------------
    32 //
    31 //
       
    32 //<qmail> aSmtpService changed to reference
       
    33 //<qmail> KMsvNullIndexEntry para removed
    33 CIpsPlgCreateForwardMessageOperation::CIpsPlgCreateForwardMessageOperation(
    34 CIpsPlgCreateForwardMessageOperation::CIpsPlgCreateForwardMessageOperation(
    34     CIpsPlgSmtpService* aSmtpService,
    35     CIpsPlgSmtpService& aSmtpService,
    35     CMsvSession& aMsvSession,
    36     CMsvSession& aMsvSession,
    36     TRequestStatus& aObserverRequestStatus,
    37     TRequestStatus& aObserverRequestStatus,
    37     TMsvPartList aPartList,
    38     TMsvPartList aPartList,
    38     TFSMailMsgId aMailBoxId,
    39     TFSMailMsgId aMailBoxId,
    39     TMsvId aOriginalMessageId, 
    40     TMsvId aOriginalMessageId, 
    42     :
    43     :
    43     CIpsPlgCreateMessageOperation(
    44     CIpsPlgCreateMessageOperation(
    44         aSmtpService,
    45         aSmtpService,
    45         aMsvSession,
    46         aMsvSession,
    46         aObserverRequestStatus,
    47         aObserverRequestStatus,
    47         KMsvNullIndexEntryId,
       
    48         aPartList,
    48         aPartList,
    49         aMailBoxId,
    49         aMailBoxId,
    50         aOperationObserver,
    50         aOperationObserver,
    51         aRequestId),
    51         aRequestId),
    52     iOriginalMessageId(aOriginalMessageId)
    52     iOriginalMessageId(aOriginalMessageId)
    53     {
    53     {
    54     FUNC_LOG;
    54     FUNC_LOG;
    55     }
    55     }
       
    56 //</qmail>	
    56 
    57 
    57 
    58 
    58 // ----------------------------------------------------------------------------
    59 // ----------------------------------------------------------------------------
    59 // CIpsPlgCreateForwardMessageOperation::NewL
    60 // CIpsPlgCreateForwardMessageOperation::NewL
    60 // ----------------------------------------------------------------------------
    61 // ----------------------------------------------------------------------------
    61 //
    62 //
       
    63 //<qmail> aSmtpService changed to reference
    62 CIpsPlgCreateForwardMessageOperation* CIpsPlgCreateForwardMessageOperation::NewL(
    64 CIpsPlgCreateForwardMessageOperation* CIpsPlgCreateForwardMessageOperation::NewL(
    63     CIpsPlgSmtpService* aSmtpService,
    65     CIpsPlgSmtpService& aSmtpService,
    64     CMsvSession& aMsvSession,
    66     CMsvSession& aMsvSession,
    65     TRequestStatus& aObserverRequestStatus,
    67     TRequestStatus& aObserverRequestStatus,
    66     TMsvPartList aPartList,
    68     TMsvPartList aPartList,
    67     TFSMailMsgId aMailBoxId,
    69     TFSMailMsgId aMailBoxId,
    68     TMsvId aOriginalMessageId, 
    70     TMsvId aOriginalMessageId, 
    69     MFSMailRequestObserver& aOperationObserver,
    71     MFSMailRequestObserver& aOperationObserver,
    70     TInt aRequestId )
    72     TInt aRequestId )
       
    73 //</qmail>	
    71     {
    74     {
    72     FUNC_LOG;
    75     FUNC_LOG;
    73     CIpsPlgCreateForwardMessageOperation* self =
    76     CIpsPlgCreateForwardMessageOperation* self =
    74         new (ELeave) CIpsPlgCreateForwardMessageOperation(
    77         new (ELeave) CIpsPlgCreateForwardMessageOperation(
    75             aSmtpService, 
    78             aSmtpService, 
    79             aMailBoxId, 
    82             aMailBoxId, 
    80             aOriginalMessageId, 
    83             aOriginalMessageId, 
    81             aOperationObserver, 
    84             aOperationObserver, 
    82             aRequestId );
    85             aRequestId );
    83     CleanupStack::PushL( self );
    86     CleanupStack::PushL( self );
    84     self->ConstructL();
    87     // <qmail>
       
    88     self->ConstructL(); // Use base class constructor
       
    89     // </qmail>
    85     CleanupStack::Pop( self ); 
    90     CleanupStack::Pop( self ); 
    86     return self;
    91     return self;
    87     }
    92     }
    88 
    93 
    89 // ----------------------------------------------------------------------------
    94 // ----------------------------------------------------------------------------
   104 
   109 
   105     if( iStatus.Int() == KErrNone )
   110     if( iStatus.Int() == KErrNone )
   106         {
   111         {
   107         // new message creation has finished so make an FS type message
   112         // new message creation has finished so make an FS type message
   108         CFSMailMessage* newMessage = NULL;
   113         CFSMailMessage* newMessage = NULL;
       
   114         //<qmail> TRAP removed
       
   115         TMsvId msgId;
   109         
   116         
   110         TMsvId msgId = TMsvId();
   117         msgId = GetIdFromProgressL( iOperation->FinalProgress() );
   111         TRAPD( err, msgId = GetIdFromProgressL( iOperation->FinalProgress() ) );
       
   112             
   118             
   113         if( err == KErrNone )
   119         newMessage = iSmtpService.CreateFSMessageAndSetFlagsL( 
   114             {
   120                 msgId, iOriginalMessageId, iFSMailboxId.Id(), ETrue );
   115             newMessage = iSmtpService->CreateFSMessageAndSetFlagsL( 
   121         //</qmail>
   116                     msgId, iOriginalMessageId, iFSMailboxId.Id(), ETrue );
       
   117             }
       
   118         
       
   119         // relay the created message (observer takes ownership)
   122         // relay the created message (observer takes ownership)
   120         SignalFSObserver( iStatus.Int(), newMessage );        
   123         SignalFSObserver( iStatus.Int(), newMessage );        
   121         }
   124         }
   122     
   125     
   123     // nothing left to process, so complete the observer
   126     // nothing left to process, so complete the observer
   132 void CIpsPlgCreateForwardMessageOperation::StartMessageCreationL()
   135 void CIpsPlgCreateForwardMessageOperation::StartMessageCreationL()
   133     {
   136     {
   134     FUNC_LOG;
   137     FUNC_LOG;
   135     delete iOperation;
   138     delete iOperation;
   136     iOperation = NULL;
   139     iOperation = NULL;
   137     
   140     //<qmail> commented parameter removed
   138     // Start a new operation, execution continues in RunL 
   141     // Start a new operation, execution continues in RunL 
   139     // once the operation has finished.
   142     // once the operation has finished.
   140     iOperation = CImEmailOperation::CreateForwardL(
   143     iOperation = CImEmailOperation::CreateForwardL(
   141             iStatus, 
   144             iStatus, 
   142             iMsvSession,
   145             iMsvSession,
   143             iOriginalMessageId,
   146             iOriginalMessageId,
   144             KMsvDraftEntryId,
   147             KMsvDraftEntryId,
   145             iPartList, 
   148             iPartList, 
   146             KIpsPlgForwardSubjectFormat,
   149             KIpsPlgForwardSubjectFormat,
   147             KMsvEmailTypeListMHTMLMessage,
   150             KMsvEmailTypeListMHTMLMessage,
   148             //0,
       
   149             KUidMsgTypeSMTP);
   151             KUidMsgTypeSMTP);
       
   152     //</qmail>
   150     }
   153     }
   151 
   154 
   152 //  End of File
   155 //  End of File
   153 
   156 
   154 // </qmail>
   157 // </qmail>