ipsservices/ipssosplugin/src/ipsplgsosbaseplugin.cpp
changeset 76 38bf5461e270
parent 74 6c59112cfd31
equal deleted inserted replaced
74:6c59112cfd31 76:38bf5461e270
   814         partList,
   814         partList,
   815         aMailBoxId,
   815         aMailBoxId,
   816         aOperationObserver,
   816         aOperationObserver,
   817         aRequestId );
   817         aRequestId );
   818     //</qmail>
   818     //</qmail>
   819     watcher->SetOperation( op );
   819     watcher->SetOperation( op ); // takes ownership of op
   820 
   820 
   821     iOperations.AppendL( watcher );
   821     iOperations.AppendL( watcher );
   822     CleanupStack::Pop( watcher );
   822     CleanupStack::Pop( watcher );
   823     }
   823     }
   824 // </qmail>
   824 // </qmail>
   859         {
   859         {
   860         User::Leave(KErrNotFound);
   860         User::Leave(KErrNotFound);
   861         }
   861         }
   862 
   862 
   863     if ( ( orgMsg.Parent() == KMsvSentEntryIdValue ) &&
   863     if ( ( orgMsg.Parent() == KMsvSentEntryIdValue ) &&
   864          ( orgMsg.iMtm == KSenduiMtmSmtpUid ) )
   864          ( orgMsg.iMtm == KUidMsgTypeSMTP ) )
   865         {
   865         {
   866         iSmtpService->ChangeServiceIdL( orgMsg );
   866         iSmtpService->ChangeServiceIdL( orgMsg );
   867         }
   867         }
   868 
   868 
   869     TMsvPartList partList( KMsvMessagePartBody | KMsvMessagePartAttachments );
   869     TMsvPartList partList( KMsvMessagePartBody | KMsvMessagePartAttachments );
   879         aMailBoxId,
   879         aMailBoxId,
   880         orgMsg.Id(),
   880         orgMsg.Id(),
   881         aOperationObserver,
   881         aOperationObserver,
   882         aRequestId );
   882         aRequestId );
   883     //</qmail>
   883     //</qmail>
   884     watcher->SetOperation( op );
   884     watcher->SetOperation( op ); // takes ownership of op
   885 
   885 
   886     iOperations.AppendL( watcher );
   886     iOperations.AppendL( watcher );
   887     CleanupStack::Pop( watcher );
   887     CleanupStack::Pop( watcher );
   888     }
   888     }
   889 // </qmail>
   889 // </qmail>
   925         {
   925         {
   926         User::Leave(KErrNotFound);
   926         User::Leave(KErrNotFound);
   927         }
   927         }
   928 
   928 
   929     if ( ( orgMsg.Parent() == KMsvSentEntryIdValue ) &&
   929     if ( ( orgMsg.Parent() == KMsvSentEntryIdValue ) &&
   930          ( orgMsg.iMtm == KSenduiMtmSmtpUid ) )
   930          ( orgMsg.iMtm == KUidMsgTypeSMTP ) )
   931         {
   931         {
   932         iSmtpService->ChangeServiceIdL( orgMsg );
   932         iSmtpService->ChangeServiceIdL( orgMsg );
   933         }
   933         }
   934 
   934 
   935     // partList flags control e.g. what kind of recipient set is created
   935     // partList flags control e.g. what kind of recipient set is created
   951         aMailBoxId,
   951         aMailBoxId,
   952         orgMsg.Id(),
   952         orgMsg.Id(),
   953         aOperationObserver,
   953         aOperationObserver,
   954         aRequestId );
   954         aRequestId );
   955     //</qmail>
   955     //</qmail>
   956     watcher->SetOperation( op );
   956     watcher->SetOperation( op ); // takes ownership of op
   957 
   957 
   958     iOperations.AppendL( watcher );
   958     iOperations.AppendL( watcher );
   959     CleanupStack::Pop( watcher );
   959     CleanupStack::Pop( watcher );
   960     }
   960     }
   961 // </qmail>
   961 // </qmail>
   979         {
   979         {
   980         status = iSession->GetEntry( msgId.Id( ), serviceId, tEntry );
   980         status = iSession->GetEntry( msgId.Id( ), serviceId, tEntry );
   981 
   981 
   982         if ( status == KErrNone )
   982         if ( status == KErrNone )
   983             {
   983             {
   984             incoming = ( tEntry.iMtm == KSenduiMtmImap4Uid ) ||
   984             incoming = ( tEntry.iMtm == KUidMsgTypeIMAP4 ) ||
   985                 ( tEntry.iMtm == KSenduiMtmPop3Uid );
   985                 ( tEntry.iMtm == KUidMsgTypePOP3 );
   986             }
   986             }
   987         }
   987         }
   988 
   988 
   989     if ( incoming )
   989     if ( incoming )
   990         {
   990         {
  1034                     *this,
  1034                     *this,
  1035                     messages,
  1035                     messages,
  1036                     aOperationObserver,
  1036                     aOperationObserver,
  1037                     aRequestId );
  1037                     aRequestId );
  1038 
  1038 
  1039     watcher->SetOperation(op);
  1039     watcher->SetOperation(op); // takes ownership of op
  1040     iOperations.AppendL(watcher);
  1040     iOperations.AppendL(watcher);
  1041     CleanupStack::Pop( 2, watcher );
  1041     CleanupStack::Pop( 2, watcher );
  1042     }
  1042     }
  1043 // </qmail>
  1043 // </qmail>
  1044 
  1044 
  1136         aContentType,
  1136         aContentType,
  1137         aFilePath,
  1137         aFilePath,
  1138         aOperationObserver,
  1138         aOperationObserver,
  1139         aRequestId,
  1139         aRequestId,
  1140         iMsgMapper);
  1140         iMsgMapper);
  1141     watcher->SetOperation( op );
  1141     watcher->SetOperation( op ); // takes ownership of op
  1142 
  1142 
  1143     iOperations.AppendL( watcher );
  1143     iOperations.AppendL( watcher );
  1144     CleanupStack::Pop( watcher );
  1144     CleanupStack::Pop( watcher );
  1145     }
  1145     }
  1146 // </qmail>
  1146 // </qmail>
  1212         watcher->iStatus,
  1212         watcher->iStatus,
  1213         aMessageId,
  1213         aMessageId,
  1214         aPartId,
  1214         aPartId,
  1215         aOperationObserver,
  1215         aOperationObserver,
  1216         aRequestId);
  1216         aRequestId);
  1217     watcher->SetOperation( op );
  1217     watcher->SetOperation( op ); // takes ownership of op
  1218 
  1218 
  1219     iOperations.AppendL( watcher );
  1219     iOperations.AppendL( watcher );
  1220     CleanupStack::Pop( watcher );
  1220     CleanupStack::Pop( watcher );
  1221 
  1221 
  1222     }
  1222     }
  1485     CIpsPlgMessagePartStorerOperation* op =
  1485     CIpsPlgMessagePartStorerOperation* op =
  1486             CIpsPlgMessagePartStorerOperation::NewLC(*iSession,
  1486             CIpsPlgMessagePartStorerOperation::NewLC(*iSession,
  1487                     watcher->iStatus, *this, aMessageParts,
  1487                     watcher->iStatus, *this, aMessageParts,
  1488                     aOperationObserver, aRequestId);
  1488                     aOperationObserver, aRequestId);
  1489 
  1489 
  1490     watcher->SetOperation(op);
  1490     watcher->SetOperation(op); // takes ownership of op
  1491     iOperations.AppendL(watcher);
  1491     iOperations.AppendL(watcher);
  1492     CleanupStack::Pop( 2, watcher );
  1492     CleanupStack::Pop( 2, watcher );
  1493     }
  1493     }
  1494 //<//qmail>
  1494 //<//qmail>
  1495 
  1495 
  1686     CleanupStack::PushL( watcher );
  1686     CleanupStack::PushL( watcher );
  1687     //<qmail>
  1687     //<qmail>
  1688     CMsvOperation* op = CIpsPlgDeleteOperation::NewL( *iSession,
  1688     CMsvOperation* op = CIpsPlgDeleteOperation::NewL( *iSession,
  1689         watcher->iStatus, sel );
  1689         watcher->iStatus, sel );
  1690     //</qmail>
  1690     //</qmail>
  1691     watcher->SetOperation( op );
  1691     watcher->SetOperation( op ); // takes ownership of op
  1692     iOperations.AppendL( watcher );
  1692     iOperations.AppendL( watcher );
  1693     CleanupStack::Pop( watcher );
  1693     CleanupStack::Pop( watcher );
  1694     //<qmail>
  1694     //<qmail>
  1695     CleanupStack::Pop( sel );
  1695     CleanupStack::Pop( sel );
  1696     //</qmail>
  1696     //</qmail>
  1726 
  1726 
  1727     CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewL( *this );
  1727     CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewL( *this );
  1728     CleanupStack::PushL( watcher );
  1728     CleanupStack::PushL( watcher );
  1729     CMsvOperation* op = CIpsPlgDeleteOperation::NewL( *iSession,
  1729     CMsvOperation* op = CIpsPlgDeleteOperation::NewL( *iSession,
  1730         watcher->iStatus, sel, aOperationObserver, aRequestId );
  1730         watcher->iStatus, sel, aOperationObserver, aRequestId );
  1731     watcher->SetOperation( op );
  1731     watcher->SetOperation( op ); // takes ownership of op
  1732     iOperations.AppendL( watcher );
  1732     iOperations.AppendL( watcher );
  1733     CleanupStack::Pop( watcher );
  1733     CleanupStack::Pop( watcher );
  1734     CleanupStack::Pop( sel );
  1734     CleanupStack::Pop( sel );
  1735     }
  1735     }
  1736 // </qmail>
  1736 // </qmail>
  1951 	if( ( aEntry->Entry().iDetails.CompareF( KIpsPlgInbox ) == 0 ) &&
  1951 	if( ( aEntry->Entry().iDetails.CompareF( KIpsPlgInbox ) == 0 ) &&
  1952 		( aEntry->Entry().iType == KUidMsvFolderEntry ) )
  1952 		( aEntry->Entry().iType == KUidMsvFolderEntry ) )
  1953         {
  1953         {
  1954         folderType = EFSInbox;
  1954         folderType = EFSInbox;
  1955         }
  1955         }
  1956 	else if( ( aEntry->Entry().iMtm == KSenduiMtmPop3Uid ) &&
  1956 	else if( ( aEntry->Entry().iMtm == KUidMsgTypePOP3 ) &&
  1957 	         ( aEntry->Entry().iType == KUidMsvServiceEntry ) &&
  1957 	         ( aEntry->Entry().iType == KUidMsvServiceEntry ) &&
  1958 	         ( aEntry->Entry().iServiceId == aFolderId.Id() ) )
  1958 	         ( aEntry->Entry().iServiceId == aFolderId.Id() ) )
  1959 	    {
  1959 	    {
  1960 	    folderType = EFSInbox;
  1960 	    folderType = EFSInbox;
  1961         }
  1961         }
  2154             ActivityTimerL( aMailBoxId ),
  2154             ActivityTimerL( aMailBoxId ),
  2155             aMailBoxId,
  2155             aMailBoxId,
  2156             &aObserver,
  2156             &aObserver,
  2157             aRequestId );
  2157             aRequestId );
  2158 
  2158 
  2159         watcher->SetOperation( op );
  2159         watcher->SetOperation( op ); // takes ownership of op
  2160         CleanupStack::PopAndDestroy( sel );
  2160         CleanupStack::PopAndDestroy( sel );
  2161         iOperations.AppendL( watcher );
  2161         iOperations.AppendL( watcher );
  2162         CleanupStack::Pop( watcher );
  2162         CleanupStack::Pop( watcher );
  2163         }
  2163         }
  2164     }
  2164     }
  2197  	CleanupStack::PushL(watcher);
  2197  	CleanupStack::PushL(watcher);
  2198 // <qmail>
  2198 // <qmail>
  2199     CIpsPlgSmtpOperation* op = CIpsPlgSmtpOperation::NewLC( *iSession, watcher->iStatus );
  2199     CIpsPlgSmtpOperation* op = CIpsPlgSmtpOperation::NewLC( *iSession, watcher->iStatus );
  2200 // </qmail>
  2200 // </qmail>
  2201     op->SetEventHandler(iEventHandler);
  2201     op->SetEventHandler(iEventHandler);
  2202     watcher->SetOperation(op);
  2202     watcher->SetOperation(op); // takes ownership of op
  2203     op->EmptyOutboxFromPendingMessagesL( aMailBoxId.Id() );
  2203     op->EmptyOutboxFromPendingMessagesL( aMailBoxId.Id() );
  2204     iOperations.AppendL(watcher);
  2204     iOperations.AppendL(watcher);
  2205     CleanupStack::Pop( 2, watcher );
  2205     CleanupStack::Pop( 2, watcher );
  2206     }
  2206     }
  2207 
  2207 
  2397 // ---------------------------------------------------------------------------
  2397 // ---------------------------------------------------------------------------
  2398 // ---------------------------------------------------------------------------
  2398 // ---------------------------------------------------------------------------
  2399 TUid CIpsPlgSosBasePlugin::MtmId() const
  2399 TUid CIpsPlgSosBasePlugin::MtmId() const
  2400     {
  2400     {
  2401     FUNC_LOG;
  2401     FUNC_LOG;
  2402     TUid ret = KSenduiMtmImap4Uid;
  2402     TUid ret = KUidMsgTypeIMAP4;
  2403     if ( iFSPluginId == KIpsPlgPop3PluginUidValue )
  2403     if ( iFSPluginId == KIpsPlgPop3PluginUidValue )
  2404         {
  2404         {
  2405         ret = KSenduiMtmPop3Uid;
  2405         ret = KUidMsgTypePOP3;
  2406         }
  2406         }
  2407     return ret;
  2407     return ret;
  2408     }
  2408     }
  2409 
  2409 
  2410 // ---------------------------------------------------------------------------
  2410 // ---------------------------------------------------------------------------
  2466 
  2466 
  2467 
  2467 
  2468     //currently, no actions unless this is inbox
  2468     //currently, no actions unless this is inbox
  2469     //also, if id is '0', it means inbox before first sync...it doesn't really exist yet
  2469     //also, if id is '0', it means inbox before first sync...it doesn't really exist yet
  2470     if( folder.iDetails.CompareF( KIpsPlgInbox ) == 0 || folder.Id() == 0 ||
  2470     if( folder.iDetails.CompareF( KIpsPlgInbox ) == 0 || folder.Id() == 0 ||
  2471             ( folder.iMtm == KSenduiMtmPop3Uid ) &&
  2471             ( folder.iMtm == KUidMsgTypePOP3 ) &&
  2472             ( folder.iType == KUidMsvServiceEntry ) &&
  2472             ( folder.iType == KUidMsvServiceEntry ) &&
  2473             ( folder.iServiceId == aActiveFolderId.Id() ) )
  2473             ( folder.iServiceId == aActiveFolderId.Id() ) )
  2474         {
  2474         {
  2475         //folder is inbox
  2475         //folder is inbox
  2476         if ( iSyncStateHandler->GetMailboxIpsState( aActiveMailboxId.Id() )
  2476         if ( iSyncStateHandler->GetMailboxIpsState( aActiveMailboxId.Id() )