/* ----------------------------------------------------------------------------- ---------------------------------------------------------------------------- */ void CSMSMonitor::CheckInboxL(void) { TInt smsCount(0),mmsCount(0); CMsvEntry* Entrie = iSession->GetEntryL(KMsvGlobalInBoxIndexEntryId); if(Entrie) { CleanupStack::PushL(Entrie); if(Entrie->Count()) { TMsvSelectionOrdering MySortType; MySortType.SetSorting(EMsvSortByDate); Entrie->SetSortTypeL(MySortType); CMsvEntrySelection* entries = Entrie->ChildrenL(); if(entries) { CleanupStack::PushL(entries); for(TInt i = (entries->Count() - 1); i >= 0; i--) { if(Entrie->ChildDataL(entries->At(i)).Unread()) { if(Entrie->ChildDataL(entries->At(i)).iMtm == KUidMsgTypeSMS) { smsCount++; } else if(Entrie->ChildDataL(entries->At(i)).iMtm == KUidMsgTypeMultimedia) { mmsCount++; } } } CleanupStack::PopAndDestroy(entries); } } CleanupStack::PopAndDestroy(1);//Entrie } if(iObserver){ iObserver->InboxChangedL(smsCount,mmsCount); } }
/** GetMessagePartIndexL() Retrieves the part index id for the email identified by aEntry @param aEntry A valid email identifier @param aUid An identifier tfor the type of message part to be retrieved @return TMsvId - message part identifier */ TMsvId CT_MsgComparePopEmailMsgs::GetMessagePartIndexL(TMsvEntry& aEntry, TUid aUid) { static TBool msgPartFound = EFalse; TMsvId msgPartId = 0; CMsvEntry* baseEntry = iSharedDataPOP.iSession->GetEntryL(aEntry.Id()); CleanupStack::PushL(baseEntry); CMsvEntrySelection* selection = baseEntry->ChildrenL(); CleanupStack::PushL(selection); TInt count = selection->Count(); TInt ind1; CMsvEntry* entry = iSharedDataPOP.iSession->GetEntryL(KMsvRootIndexEntryId); CleanupStack::PushL(entry); for (ind1=0, msgPartFound=EFalse; ind1 < count; ind1++) { if(msgPartFound) { break; } TMsvId childId = selection->At(ind1); entry->SetEntryL(childId); if (entry->Entry().iType == aUid) { msgPartId = childId; break; } else if (entry->Entry().iType == KUidMsvFolderEntry) { TMsvEntry ent = entry->Entry(); msgPartId = GetMessagePartIndexL(ent, aUid); } } CleanupStack::PopAndDestroy(3, baseEntry); // entry,selection,baseEntry return msgPartId; }
void CBulkCommitServerMtm::ConstructL() { // Get the entry id for the bulkcommit service entry. User::LeaveIfError(iServerEntry->SetEntry(KMsvRootIndexEntryId)); CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection(); CleanupStack::PushL(sel); User::LeaveIfError(iServerEntry->GetChildrenWithMtm(KUidBulkCommitTestMtm, *sel)); TInt count = sel->Count(); if( count > 1 ) // should only be one service entry { User::Leave(KErrCorrupt); } if( count == 0 ) { // Create the settings TMsvEntry serviceEntry; serviceEntry.iType= KUidMsvServiceEntry; serviceEntry.iMtm = KUidBulkCommitTestMtm; User::LeaveIfError(iServerEntry->CreateEntry(serviceEntry)); iServiceId = serviceEntry.Id(); } else { iServiceId = sel->At(0); } CleanupStack::PopAndDestroy(sel); }
// methods from CSendAsEditUtils void CSendAsTestEditUtils::LaunchEditorL(TMsvId /*aId*/, TRequestStatus& aStatus) { CDummyObserver* ob1 = new(ELeave) CDummyObserver; CleanupStack::PushL(ob1); CMsvSession* session = CMsvSession::OpenSyncL(*ob1); CleanupStack::PushL(session); CMsvEntry* cEntry = CMsvEntry::NewL(*session, KMsvDraftEntryId, TMsvSelectionOrdering(KMsvNoGrouping,EMsvSortByNone,ETrue)); CleanupStack::PushL(cEntry); CMsvEntrySelection* selection = cEntry->ChildrenL(); CleanupStack::PushL(selection); CMsvEntry* cEntry2 = session->GetEntryL(selection->At(0)); CleanupStack::PushL(cEntry2); TMsvEntry entry = cEntry2->Entry(); entry.SetMtmData3(234567890); // Show we've been called by touching the TMsvEntry. cEntry2->ChangeL(entry); CleanupStack::PopAndDestroy(5, ob1); // cEntry2, selection, cEntry, session, ob1 iUserStatus = &aStatus; aStatus = KRequestPending; // wait a few seconds before completing iEditTimer->After(KSendAsTestEditWaitTime); }
void CMsvServerEntry::DoMoveEntriesL(CMsvEntrySelection& aSelection, TMsvId aDestination, CMsvEntrySelection*& aMoved) { __ASSERT_DEBUG(!aMoved, PanicServer(EMsvMoveSelectionNotNull)); __ASSERT_DEBUG(aSelection.Count() > 0, PanicServer(EMsvMovingEmptySelection)); aMoved = new(ELeave)CMsvEntrySelection; aMoved->SetReserveL(aSelection.Count()); CMsvMove* move = CMsvMove::NewL(iServer); CleanupStack::PushL(move); TInt error = KErrNone; TInt count = aSelection.Count(); while(count--) { TMsvId id = aSelection.At(count); if (!IsAChild(id)) error = KErrNotFound; else { move->StartL(id, aDestination); aSelection.Delete(count); aMoved->AppendL(id); } } User::LeaveIfError(error); CleanupStack::PopAndDestroy(); // move }
// ----------------------------------------------------------------------------- // CMmsAdapterMsvApi::FindUserFolderL // ----------------------------------------------------------------------------- // TBool CMmsAdapterMsvApi::FindUserFolderL( TMsvId aFolder, TPtrC& aName, TTime& aDate ) { TBool found( EFalse ); CMsvEntry* entry = iSession.GetEntryL( KMsvMyFoldersEntryIdValue ); CleanupStack::PushL( entry ); CMsvEntrySelection* selection = entry->ChildrenL(); CleanupStack::PushL( selection ); TMsvId serviceId; TMsvEntry entryT; for ( TInt i = 0; i < selection->Count(); i++ ) { User::LeaveIfError( iSession.GetEntry( selection->At( i ), serviceId, entryT ) ); if ( !entryT.Deleted() && entryT.iType == KUidMsvFolderEntry && entryT.Id() == aFolder ) { found = ETrue; aDate = entryT.iDate; aName.Set( entryT.iDetails ); break; } } CleanupStack::PopAndDestroy( selection ); CleanupStack::PopAndDestroy( entry ); return found; }
void CMsvScheduleSend::GetMessagesL(const CMsvEntrySelection& aSelection) { iSchEntries->ResetAndDestroy(); const TInt entryCount = aSelection.Count(); iSchEntries->SetReserveL(entryCount); //so following AppendL()s won't leave CMsvScheduledEntry* schEntry = NULL; for (TInt curMsg = 0; curMsg < entryCount; ++curMsg) //not while because must transverse forward { //Retrieve each message from the message server TMsvId msvId = aSelection.At(curMsg); TRAPD(error, schEntry = GetMessageL(msvId)); if (error == KErrNone) { CleanupStack::PushL(schEntry); iSchEntries->AppendL(schEntry); CleanupStack::Pop(schEntry); } else if (error != KErrLocked && error != KErrNotFound) { User::Leave(error); } } }
void CPigeonServerMtm::ConstructL() { iScheduleSend = CPigeonScheduledSend::NewL(*iServerEntry); // Get the entry id for the pigeon service entry. User::LeaveIfError(iServerEntry->SetEntry(KMsvRootIndexEntryId)); CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection(); CleanupStack::PushL(sel); User::LeaveIfError(iServerEntry->GetChildrenWithMtm(KUidMsgTypePigeon, *sel)); TInt count = sel->Count(); if( count > 1 ) // should only be one service entry User::Leave(KErrCorrupt); if( count == 0 ) { // Create the settings TMsvEntry serviceEntry; serviceEntry.iType= KUidMsvServiceEntry; serviceEntry.iMtm = KUidMsgTypePigeon; User::LeaveIfError(iServerEntry->CreateEntry(serviceEntry)); iServiceId = serviceEntry.Id(); } else { iServiceId = sel->At(0); } CleanupStack::PopAndDestroy(sel); User::LeaveIfError(iServerEntry->SetEntry(KMsvNullIndexEntryId)); iHeapFailure = EFalse; }
EXPORT_C void CMsvTestUtils::DeleteServiceL(TUid aMtm) { CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection(); CleanupStack::PushL(sel); TMsvId firstId = 0; TRAPD(err, ServiceIdL(aMtm, firstId, sel)); if (!err) { TInt count = sel->Count(); while (count--) { TMsvId del = sel->At(count); TRAP(err, SetEntryL(del)); if (!err) { TRAP(err, SetEntryL(Entry().Parent())); if (!err) { TRAP(err, DeleteEntryL(del)); } } if (err) { Printf(_L("Error deleting service entry\n")); } } } CleanupStack::PopAndDestroy(); //sel }
// ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- void CIpsPlgImap4PopulateOp::ConstructL( const CMsvEntrySelection& aSel, TBool aDoFilterSelection ) { FUNC_LOG; BaseConstructL( KUidMsgTypeIMAP4 ); // <qmail> instantiation moved here iSelection = new ( ELeave ) CMsvEntrySelection(); iTempSelection = new ( ELeave ) CMsvEntrySelection(); if ( aDoFilterSelection ) { FilterSelectionL( aSel ); } else // no filtering; populate all { // first entry in selection is serviceId for ( TInt i = 1; i < aSel.Count(); i++ ) { if ( aSel[i] != iService ) { iSelection->AppendL( aSel.At(i) ); } } } DoConnectL(); }
// ----------------------------------------------------------------------------- // CMmsAdapterMsvApi::FindUserFolderL // ----------------------------------------------------------------------------- // TBool CMmsAdapterMsvApi::FindUserFolderL( const TDesC& aName, TMsvId& aFolder ) { CMsvEntry* entry = iSession.GetEntryL( KMsvMyFoldersEntryIdValue ); CleanupStack::PushL( entry ); CMsvEntrySelection* selection = entry->ChildrenL(); CleanupStack::PushL( selection ); TBool found( EFalse ); TMsvId serviceId; TMsvEntry entryT; for ( TInt i = 0; i < selection->Count(); i++ ) { User::LeaveIfError( iSession.GetEntry( selection->At( i ), serviceId, entryT ) ); if ( !entryT.Deleted() && entryT.iType == KUidMsvFolderEntry && aName.Compare(entryT.iDescription) == 0 ) { found = ETrue; aFolder = entryT.Id(); break; } } CleanupStack::PopAndDestroy( selection ); CleanupStack::PopAndDestroy( entry ); return found; }
LOCAL_C void TestHiddenEntryStreamsL() { CDummyObserver ob; CMsvSession* session = CMsvSession::OpenSyncL(ob); CleanupStack::PushL(session); CMsvEntry* cEntry1 = CMsvEntry::NewL(*session, KMsvRootIndexEntryId, TMsvSelectionOrdering(KMsvNoGrouping, EMsvSortByNone, ETrue)); CleanupStack::PushL(cEntry1); TMsvSelectionOrdering sort(KMsvNoGrouping, EMsvSortByNone, ETrue); cEntry1->SetSortTypeL(sort); // all services CMsvEntrySelection* selection = cEntry1->ChildrenL(); TInt count=selection->Count(); while (count--) TestEntryStream(*cEntry1, selection->At(count), selection->At(count), EFalse); delete selection; // local entries TestEntryStream(*cEntry1, KMsvLocalServiceIndexEntryId, KMsvLocalServiceIndexEntryId, ETrue); CleanupStack::PopAndDestroy(2); // cEntry1,session }
// ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // void CIpsSosAOImapPopLogic::UpdateLogicArrayL( const CMsvEntrySelection& aChilds ) { FUNC_LOG; for ( TInt i = 0; i < aChilds.Count(); i++ ) { TBool found = EFalse; TMsvId mboxId = aChilds.At(i); for ( TInt j = 0; !found && j < iMailboxLogics.Count(); j++ ) { if ( iMailboxLogics[j]->GetMailboxId() == mboxId ) { found = ETrue; } } //<QMail> CIpsSosAOSettingsHandler* settings = CIpsSosAOSettingsHandler::NewL(iSession, mboxId); CleanupStack::PushL(settings); if ( !found && ( settings->AlwaysOnlineState() != IpsServices::EMailAoOff || settings->EmailNotificationState() != IpsServices::EMailEmnOff || !settings->FirstEmnReceived() ) ) { CIpsSosAOMBoxLogic* newLogic = CIpsSosAOMBoxLogic::NewL( iSession, mboxId ); CleanupStack::PushL( newLogic ); iMailboxLogics.AppendL( newLogic ); CleanupStack::Pop( newLogic ); } else if ( found && settings->AlwaysOnlineState() == IpsServices::EMailAoOff && settings->EmailNotificationState() == IpsServices::EMailEmnOff && settings->FirstEmnReceived() ) { StopAndRemoveMailboxL( mboxId ); } CleanupStack::PopAndDestroy(settings); //</QMail> } //finally, check for orphans ( mailbox has been deleted ) RemoveOrphanLogicsL(); }
TBool CMsvServerEntry::AreChildren(const CMsvEntrySelection& aSelection) const // // Returns true if all the entries are children // { TInt count = aSelection.Count(); while (count--) { if (!IsAChild(aSelection.At(count))) { return EFalse; } } return ETrue; }
LOCAL_C void TestEntryStream(CMsvEntry& aEntry, TMsvId aId, TMsvId aService, TBool aAllDescendents) { // get the store aEntry.SetEntryL(aId); CMsvStore* store=NULL; if(aEntry.HasStoreL()) store = aEntry.ReadStoreL(); test(store==NULL || store->IsPresentL(KUidMsvHiddenEntryStream)==EFalse); delete store; // recurse into the children if (aAllDescendents) { CMsvEntrySelection* selection = aEntry.ChildrenL(); TInt count=selection->Count(); while (count--) TestEntryStream(aEntry, selection->At(count), aService, EFalse); delete selection; } }
EXPORT_C void CMsvTestUtils::ServiceIdL(TUid aMtm, TMsvId& rFirstId, CMsvEntrySelection* rServiceIds) { //Returns the Service IDs of MTM aMtm rFirstId = KMsvNullIndexEntryId; SetEntryL(KMsvRootIndexEntryId); // TMsvSelectionOrdering oldOrder = aEntry.SortType(); TMsvSelectionOrdering order; order.SetShowInvisibleEntries(ETrue); SetSortTypeL(order); //Get the children on the Root Index Entry CMsvEntrySelection* selection = ChildrenWithTypeLC(KUidMsvServiceEntry); TInt count = selection->Count(); //Find an entry for MTM aMtm for (TInt curChild = 0; curChild < count && (rFirstId == KMsvNullIndexEntryId || rServiceIds); curChild++) { SetEntryL(selection->At(curChild)); if (Entry().iMtm == aMtm) { TMsvId id = Entry().Id(); if (rFirstId == KMsvNullIndexEntryId) rFirstId = id; if (rServiceIds) rServiceIds->AppendL(id); } } //Leave if no Service Entry found for MTM aMtm if (rFirstId == KMsvNullIndexEntryId) { CleanupStack::PopAndDestroy(); //selection User::Leave(KErrNotFound); } CleanupStack::PopAndDestroy(); //selection }
/* ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- */ void CSMSSender::HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* /*aArg2*/, TAny* /*aArg3*/) { switch (aEvent) { case EMsvEntriesChanged: { // Find out what happened to the message we scheduled for sending if (iPhase == EWaitingForSent) { // We take the moved entries into a selection CMsvEntrySelection* entries = static_cast<CMsvEntrySelection*>(aArg1); //Process each created entry, one at a time. for(TInt i = 0; i < entries->Count(); i++) { HandleChangedEntryL(entries->At(i)); } } } break; case EMsvEntriesCreated: // A new entry has been created in the message server case EMsvEntriesMoved: // this event is given when message entries are moved {// } break; case EMsvServerReady: break; case EMsvCloseSession: iSession->CloseMessageServer(); break; case EMsvServerTerminated: iSession->CloseMessageServer(); break; case EMsvGeneralError: case EMsvServerFailedToStart: iObserver.HandleError(MMsvObserver::EFatalServerError); break; default: // All other events are ignored break; } }
// --------------------------------------------------------- // GetOutboxEntries() // Outgoing Pending message/messages // --------------------------------------------------------- TInt MsgStoreHandler::GetOutboxEntriesL(MsgInfo& aFailedIndicatorData, MsgInfo& aPendingIndicatorData) { CMsvEntry* rootEntry = iMsvSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId); CMsvEntrySelection* messages = rootEntry->ChildrenL(); TInt failedMessageCount = 0; TInt pendingMessageCount = 0; for (TInt i = 0; i < messages->Count(); ++i) { TMsvEntry entry = rootEntry->ChildDataL(messages->At(i)); if ((entry.iMtm != KSenduiMtmSmsUid) && (entry.iMtm != KSenduiMtmMmsUid)) { continue; } if (entry.SendingState() == KMsvSendStateFailed) { ++failedMessageCount; } else { ++pendingMessageCount; } if (entry.SendingState() == KMsvSendStateFailed) { ProcessIndicatorDataL(entry.Id(), aFailedIndicatorData); } else { ProcessIndicatorDataL(entry.Id(), aPendingIndicatorData); } } aFailedIndicatorData.mFromSingle = (failedMessageCount > 1) ? false : true; aPendingIndicatorData.mFromSingle = (pendingMessageCount > 1) ? false : true; aFailedIndicatorData.mIndicatorType = FailedIndicatorPlugin; aPendingIndicatorData.mIndicatorType = PendingIndicatorPlugin; aFailedIndicatorData.mMsgCount = failedMessageCount; aPendingIndicatorData.mMsgCount = pendingMessageCount; return KErrNone; }
void CMsvIndexContext::DoCreateServiceDirsL() #endif { CMsvEntryFilter* filter = CMsvEntryFilter::NewLC(); filter->SetOrder(TMsvSelectionOrdering(0, EMsvSortByNone, ETrue)); CMsvEntrySelection* selection = new(ELeave)CMsvEntrySelection; CleanupStack::PushL(selection); TInt err = KErrNone; #if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT) err = iIndexAdapter->GetChildrenId(MaskTMsvId(aDriveId, KMsvRootIndexEntryId), *filter, *selection); #else err = iIndexAdapter->GetChildrenId(KMsvRootIndexEntryId, *filter, *selection); #endif // make sure the service directories are there if (err == KErrNone) { TInt count = selection->Count(); while (count--) { TFileName filename; filename.Copy(iMessageFolder); TMsvId id = selection->At(count); #if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT) MsvUtils::ConstructEntryName(UnmaskTMsvId(id), MaskTMsvId(aDriveId, id), filename, MsvUtils::EPath); #else MsvUtils::ConstructEntryName(id, id, filename, MsvUtils::EPath); #endif iServer.FileSession().MkDir(filename); // ignore any error } } CleanupStack::PopAndDestroy(2); // selection, filter }
/** Function : ImapMoveAsyncFunctionWithSelection Description : Calls MoveAsyncImap4CommandL after creating a selection object with all the children entries appended to the selection object @param : aCommand The Imap command to be executed. aImapServiceId The Imap service Id aMailSelection The selection object aDownloadLimits The download limts set. aFolderId The folder Id @return : none */ void CT_MsgImapMoveAsyncFunction::ImapMoveAsyncFunctionWithSelectionL(TImap4Cmds aCommand,TMsvId aImapServiceId, CMsvEntrySelection& aMailSelection, TBool aDownloadLimits,TMsvId aFolderId) { // Create a new selection object iMailSelection = new (ELeave) CMsvEntrySelection; // The first entry in this selection MUST be the IMAP service iMailSelection->InsertL(0, aImapServiceId); // Gets a count of the children entries of the remote folder TInt mailCount = aMailSelection.Count(); // Gets the Ids of all the children entries and appends it to the new selection object for (TInt index=0; index< mailCount; index++) { TMsvId msvId = aMailSelection.At(index); iMailSelection->AppendL(msvId); } // Function to Move asynchronous IMAP4-specific operation MoveAsyncImap4CommandL(aCommand, *iMailSelection, aImapServiceId, aDownloadLimits,aFolderId); }
LOCAL_C void TestRemovingAllFilesL() { CDummyObserver ob; CMsvSession* session = CMsvSession::OpenSyncL(ob); CleanupStack::PushL(session); CMsvEntry* cEntry1 = CMsvEntry::NewL(*session, KMsvLocalServiceIndexEntryId, TMsvSelectionOrdering(KMsvNoGrouping, EMsvSortByNone, ETrue)); CleanupStack::PushL(cEntry1); CMsvEntrySelection* selection; CMsvOperation* opert; CTestActive* active = new (ELeave) CTestActive; CleanupStack::PushL(active); CDir* dir; TFileName filename; TInt count; // delete everything under the outbox cEntry1->SetEntryL(KMsvGlobalOutBoxIndexEntryId); selection = cEntry1->ChildrenL(); if (selection->Count()) { active->StartL(); opert = cEntry1->DeleteL(*selection, active->iStatus); CActiveScheduler::Start(); // operation complete delete opert; } delete selection; // delete everything under the inbox cEntry1->SetEntryL(KMsvGlobalInBoxIndexEntryId); selection = cEntry1->ChildrenL(); if (selection->Count()) { active->StartL(); opert = cEntry1->DeleteL(*selection, active->iStatus); CActiveScheduler::Start(); // operation complete delete opert; } delete selection; // delete everything under the draft cEntry1->SetEntryL(KMsvDraftEntryId); selection = cEntry1->ChildrenL(); if (selection->Count()) { active->StartL(); opert = cEntry1->DeleteL(*selection, active->iStatus); CActiveScheduler::Start(); // operation complete delete opert; } delete selection; // delete everything under the sent cEntry1->SetEntryL(KMsvSentEntryId); selection = cEntry1->ChildrenL(); if (selection->Count()) { active->StartL(); opert = cEntry1->DeleteL(*selection, active->iStatus); CActiveScheduler::Start(); // operation complete delete opert; } delete selection; // delete everything under the local service cEntry1->SetEntryL(KMsvLocalServiceIndexEntryId); selection = cEntry1->ChildrenL(); count=selection->Count(); while (count--) { TMsvId id = selection->At(count); #if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT) id = UnmaskTMsvId(id); #endif if (id==KMsvGlobalOutBoxIndexEntryId || id==KMsvGlobalInBoxIndexEntryId || id==KMsvDraftEntryId || id==KMsvSentEntryId || id==KMsvDeletedEntryFolderEntryId) selection->Delete(count); } if (selection->Count()) { active->StartL(); opert = cEntry1->DeleteL(*selection, active->iStatus); CActiveScheduler::Start(); // operation complete delete opert; } delete selection; // test cEntry1->SetEntryL(KMsvRootIndexEntryId); cEntry1->SetEntryL(KMsvLocalServiceIndexEntryId); selection = cEntry1->ChildrenL(); test(selection->Count()==5); delete selection; RFs file; file.Connect(); CleanupClosePushL(file); TPtrC driveName = TDriveUnit(MessageServer::CurrentDriveL(file)).Name(); CleanupStack::PopAndDestroy(); file.Close(); filename = driveName; filename.Append(KMsvDefaultFolder2); MsvUtils::ConstructEntryName(KMsvLocalServiceIndexEntryId, KMsvLocalServiceIndexEntryId, filename, MsvUtils::EPath); REPORT_IF_ERROR(theUtils->FileSession().GetDir(filename, KEntryAttMaskSupported, ESortNone, dir)); test(dir->Count()==0); delete dir; // everything under the root cEntry1->SetEntryL(KMsvRootIndexEntryId); selection = cEntry1->ChildrenL(); count=selection->Count(); while (count--) { TMsvId id = selection->At(count); #if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT) id = UnmaskTMsvId(id); #endif if (id==KMsvLocalServiceIndexEntryId) selection->Delete(count); } if (selection->Count()) { active->StartL(); opert = cEntry1->DeleteL(*selection, active->iStatus); CActiveScheduler::Start(); // operation complete delete opert; } delete selection; #if (!defined SYMBIAN_MESSAGESTORE_USING_SQLDB) // check corrupt index flag was set when index file was corrupted TBool corrupt=session->GetAndClearIndexCorruptFlagL(); test(corrupt!=EFalse); #endif // test cEntry1->SetEntryL(KMsvLocalServiceIndexEntryId); cEntry1->SetEntryL(KMsvRootIndexEntryId); selection = cEntry1->ChildrenL(); test(selection->Count()==1); delete selection; filename = driveName; filename.Append(KMsvDefaultFolder2); REPORT_IF_ERROR(theUtils->FileSession().GetDir(filename, KEntryAttMaskSupported, ESortNone, dir)); test(dir->Count()==1); //no Index file under Mail2 folder after PREQ1189. delete dir; CleanupStack::PopAndDestroy(3); }
/** CompareEmailsL Compares body text, html text and attachments. @internalTechnology @pre None @post None */ void CMtfTestActionCompareEmails::CompareEmailsL( const CMsvEntrySelection& aMsgSelection1, const CMsvEntrySelection& aMsgSelection2) { // Verify the input parameters if( (!&aMsgSelection1) || (!&aMsgSelection2)) { TestCase().ERR_PRINTF1(_L("Invalid Message selection")); User::LeaveIfError(KErrArgument); } // Get the count of messages in both the selection object. TInt msgCount1 = aMsgSelection1.Count(); TInt msgCount2 = aMsgSelection2.Count(); TestCase().INFO_PRINTF2(_L("Message count 1 = %d"),msgCount1); TestCase().INFO_PRINTF2(_L("Message count 2 = %d"),msgCount2); if(msgCount1 != msgCount2) { // Number of messages is not equal in the selections passed TestCase().ERR_PRINTF1(_L("Message count in the selections not equal")); TestCase().SetTestStepResult(EFail); } if(IsTestCaseStatusPass()) { CMsvEntry* msvEntry1 = iParamSession->GetEntryL(KMsvRootIndexEntryId); CleanupStack::PushL(msvEntry1); CMsvEntry* msvEntry2 = iParamSession->GetEntryL(KMsvRootIndexEntryId); CleanupStack::PushL(msvEntry2); if((!msvEntry1) || (!msvEntry2)) { TestCase().ERR_PRINTF1(_L("Invalid Message Entry")); User::LeaveIfError(KErrGeneral); } // Loop through the first list of messages for ( TInt msgIndex1 = 0 ; (msgIndex1 < msgCount1) && (IsTestCaseStatusPass()); msgIndex1 ++) { TMsvId msgId1 = aMsgSelection1.At(msgIndex1); // Set the context to the first message entry msvEntry1->SetEntryL(msgId1); TBool found = EFalse; TestCase().INFO_PRINTF3(_L("Comparison of Message: %d, Subject: %S"), (msgIndex1 + 1), &(msvEntry1->Entry().iDescription)); for(TInt msgIndex2 = 0; msgIndex2 < msgCount2 && !found ; msgIndex2++) { TMsvId msgId2 = aMsgSelection2.At(msgIndex2); // Set the context to the second message entry msvEntry2->SetEntryL(msgId2); // Compare the subject field of the two messages if (msvEntry1->Entry().iDescription. Compare(msvEntry2->Entry().iDescription) == 0) { TestCase().INFO_PRINTF2(_L("Message with Subject field in the selection 1: %S found "), &(msvEntry1->Entry().iDescription)); found = ETrue; SetEmailMessageInfoL(*msvEntry1, *msvEntry2); } } if ( found ) { if(IsTestCaseStatusPass()) { ComparePlainBodyTextL(); } if(IsTestCaseStatusPass()) { CompareHtmlL(); } if(IsTestCaseStatusPass()) { CompareAttachmentsL(*msvEntry1, *msvEntry2); } if(IsTestCaseStatusPass()) { DeleteEmailMessageInfo(); } } else{ TestCase().ERR_PRINTF2(_L("Email with subject %S is not found"), &msvEntry1->Entry().iDescription); TestCase().SetTestStepResult(EFail); } } // Cleanup the stack CleanupStack::PopAndDestroy(msvEntry2); CleanupStack::PopAndDestroy(msvEntry1); } }
LOCAL_C void TestRemovingAllFilesL() { CDummyObserver ob; CMsvSession* session = CMsvSession::OpenSyncL(ob); CleanupStack::PushL(session); CMsvEntry* cEntry1 = CMsvEntry::NewL(*session, KMsvLocalServiceIndexEntryId, TMsvSelectionOrdering(KMsvNoGrouping, EMsvSortByNone, ETrue)); CleanupStack::PushL(cEntry1); CMsvEntrySelection* selection; CMsvOperation* opert; CTestActive* active = new (ELeave) CTestActive; CleanupStack::PushL(active); CDir* dir; TFileName filename; TInt count; // delete everything under the outbox cEntry1->SetEntryL(KMsvGlobalOutBoxIndexEntryId); selection = cEntry1->ChildrenL(); if (selection->Count()) { active->StartL(); opert = cEntry1->DeleteL(*selection, active->iStatus); CActiveScheduler::Start(); // operation complete delete opert; } delete selection; // delete everything under the inbox cEntry1->SetEntryL(KMsvGlobalInBoxIndexEntryId); selection = cEntry1->ChildrenL(); if (selection->Count()) { active->StartL(); opert = cEntry1->DeleteL(*selection, active->iStatus); CActiveScheduler::Start(); // operation complete delete opert; } delete selection; // delete everything under the draft cEntry1->SetEntryL(KMsvDraftEntryId); selection = cEntry1->ChildrenL(); if (selection->Count()) { active->StartL(); opert = cEntry1->DeleteL(*selection, active->iStatus); CActiveScheduler::Start(); // operation complete delete opert; } delete selection; // delete everything under the sent cEntry1->SetEntryL(KMsvSentEntryId); selection = cEntry1->ChildrenL(); if (selection->Count()) { active->StartL(); opert = cEntry1->DeleteL(*selection, active->iStatus); CActiveScheduler::Start(); // operation complete delete opert; } delete selection; // delete everything under the local service cEntry1->SetEntryL(KMsvLocalServiceIndexEntryId); selection = cEntry1->ChildrenL(); count=selection->Count(); while (count--) { TMsvId id = selection->At(count); #if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT) id = UnmaskTMsvId(id); #endif if (id==KMsvGlobalOutBoxIndexEntryId || id==KMsvGlobalInBoxIndexEntryId || id==KMsvDraftEntryId || id==KMsvSentEntryId || id==KMsvDeletedEntryFolderEntryId) selection->Delete(count); } if (selection->Count()) { active->StartL(); opert = cEntry1->DeleteL(*selection, active->iStatus); CActiveScheduler::Start(); // operation complete delete opert; } delete selection; // test cEntry1->SetEntryL(KMsvRootIndexEntryId); cEntry1->SetEntryL(KMsvLocalServiceIndexEntryId); selection = cEntry1->ChildrenL(); test(selection->Count()==5); delete selection; TestNumberOfFilesInService(KMsvLocalServiceIndexEntryId,0); // everything under the root cEntry1->SetEntryL(KMsvRootIndexEntryId); selection = cEntry1->ChildrenL(); count=selection->Count(); while (count--) { TMsvId id = selection->At(count); #if (defined SYMBIAN_MSGS_ENHANCED_REMOVABLE_MEDIA_SUPPORT) if (UnmaskTMsvId(id)==KMsvLocalServiceIndexEntryId) #else if (id==KMsvLocalServiceIndexEntryId) #endif selection->Delete(count); } if (selection->Count()) { active->StartL(); opert = cEntry1->DeleteL(*selection, active->iStatus); CActiveScheduler::Start(); // operation complete delete opert; } delete selection; // test cEntry1->SetEntryL(KMsvLocalServiceIndexEntryId); cEntry1->SetEntryL(KMsvRootIndexEntryId); selection = cEntry1->ChildrenL(); test(selection->Count()==1); delete selection; RFs file; file.Connect(); CleanupClosePushL(file); TPtrC driveName = TDriveUnit(MessageServer::CurrentDriveL(file)).Name(); CleanupStack::PopAndDestroy(); file.Close(); filename = driveName; filename.Append(KMsvDefaultFolder2); REPORT_IF_ERROR(theUtils->FileSession().GetDir(filename, KEntryAttMaskSupported, ESortNone, dir)); //Index File Will not be created in case of SQL test(dir->Count()==1); delete dir; CleanupStack::PopAndDestroy(3); }
// --------------------------------------------------------- // MsgStoreHandler::HandleSessionEventL() // --------------------------------------------------------- // void MsgStoreHandler::HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* /*aArg3*/) { CMsvEntrySelection* selection = NULL; TMsvId parent; //args if (aArg1 == NULL || aArg2 == NULL) { return; } //start, processing the event selection = (CMsvEntrySelection*) aArg1; parent = *(TMsvId*) aArg2; // Return when not (outbox or inbox) and event not EMsvEntriesChanged if (!(parent == KMsvGlobalOutBoxIndexEntryIdValue || parent == KMsvGlobalInBoxIndexEntryIdValue) && aEvent != EMsvEntriesChanged) { return; } // check for incoming class 0 sms if (parent == KMsvGlobalInBoxIndexEntryIdValue && aEvent == EMsvEntriesChanged) { CMsvEntry* inboxEntry = iMsvSession->GetEntryL(KMsvGlobalInBoxIndexEntryId); for (TInt i = 0; i < selection->Count(); ++i) { TMsvEntry entry = inboxEntry->ChildDataL(selection->At(i)); if (KSenduiMtmSmsUidValue == entry.iMtm.iUid) { CMsvEntry* msgEntry = iMsvSession->GetEntryL(entry.Id()); TMsvSmsEntry smsEntry = msgEntry->Entry(); TSmsDataCodingScheme::TSmsClass classType(TSmsDataCodingScheme::ESmsClass0); if (smsEntry.Class(classType) && smsEntry.Unread()) { HandleClass0SmsL(msgEntry, smsEntry.Id()); } else { delete msgEntry; msgEntry = NULL; } } } // for (TInt i = 0; i < selection->Count(); ++i) delete inboxEntry; } //Handling for outbox entries else if (parent == KMsvGlobalOutBoxIndexEntryIdValue) { CMsvEntry* rootEntry = iMsvSession->GetEntryL(KMsvGlobalOutBoxIndexEntryId); for (TInt i = 0; i < selection->Count(); ++i) { TMsvEntry entry = rootEntry->ChildDataL(selection->At(i)); if ((entry.iMtm == KSenduiMtmSmsUid) || (entry.iMtm == KSenduiMtmMmsUid)) { TUint sendingState = entry.SendingState(); TInt index = iFailedMessages->Find(entry.Id()); if (sendingState == KMsvSendStateFailed && KErrNotFound == index) { iFailedMessages->AppendL(entry.Id()); MsgInfo aInfo; ProcessIndicatorDataL(entry.Id(), aInfo); iNotifier->displayFailedNote(aInfo); } else if (sendingState != KMsvSendStateFailed && KErrNotFound != index) { iFailedMessages->Delete(index); iFailedMessages->Compress(); } } }//end for } else { TMsvEntry entry; TMsvId service; TInt error = KErrNone; for (TInt i = 0; i < selection->Count(); ++i) { error = iMsvSession->GetEntry(selection->At(i), service, entry); if (error == KErrNone && entry.iMtm == KUidMsgMMSNotification && MmsNotificationStatus(entry) == EMsgStatusFailed) { TInt index = iFailedMessages->Find(entry.Id()); if (KErrNotFound == index) { iFailedMessages->AppendL(entry.Id()); MsgInfo aInfo; //Fill aInfo with appropriate data aInfo.mMessageType = ECsMmsNotification; ProcessIndicatorDataL(entry.Id(), aInfo); iNotifier->displayFailedNote(aInfo); }// end of if } else if (error == KErrNone && entry.iMtm == KUidMsgMMSNotification && MmsNotificationStatus(entry) == EMsgStatusRetrieving) { TInt index = iFailedMessages->Find(entry.Id()); if (KErrNotFound != index) { iFailedMessages->Delete(index); iFailedMessages->Compress(); }// end of KErrNotFound != index if block } // end of 2nd if } // for loop } }
void CMsvServerEntry::DoDeleteEntriesL(CMsvEntrySelection& aSelection, CMsvEntrySelection*& aDeleted, CMsvEntrySelection*& aMoved) // // // { __ASSERT_DEBUG(!aDeleted && !aMoved, PanicServer(EMsvDeleteAndMoveSelectionsNotNull)); __ASSERT_DEBUG(aSelection.Count() > 0, PanicServer(EMsvDeletingEmptySelection)); // Total entries deleted and moved aDeleted = new(ELeave)CMsvEntrySelection; aMoved = new(ELeave)CMsvEntrySelection; // Entries deleted when a single item is deleted CMsvEntrySelection* deleted = new(ELeave)CMsvEntrySelection; CleanupStack::PushL(deleted); // Entries moved when a single item is deleted CMsvEntrySelection* moved = new(ELeave)CMsvEntrySelection; CleanupStack::PushL(moved); CMsvEntrySelection* selection = new(ELeave)CMsvEntrySelection; CleanupStack::PushL(selection); CMsvDelete* del = CMsvDelete::NewL(iServer); CleanupStack::PushL(del); TInt firstError = KErrNone; TInt count = aSelection.Count(); while(count--) { TMsvId id = aSelection.At(count); TInt error = KErrNone; // Only delete children if (!IsAChild(id)) error = KErrNotFound; else { // Need to know maximum number of entries that might be deleted selection->AppendL(id); error = iServer.IndexAdapter().ExpandSelectionRecursively(*selection); if (error == KErrNone) { // Reserve space in lists aDeleted->SetReserveL(aDeleted->Count() + selection->Count()); aMoved->SetReserveL(aMoved->Count() + selection->Count()); del->StartL(id, *deleted, *moved); aSelection.Delete(count); if (deleted->Count() > 0) aDeleted->AppendL(deleted->Back(0), deleted->Count()); if (moved->Count() > 0) aMoved->AppendL(moved->Back(0), moved->Count()); } deleted->Reset(); moved->Reset(); selection->Reset(); } // Remember error if (error != KErrNone && firstError == KErrNone) firstError = error; } User::LeaveIfError(firstError); CleanupStack::PopAndDestroy(4); // del, selection, moved, deleted }
void CSmsFile::HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3) { switch(aEvent) { /* case EMsvEntriesCreated: { if (!aArg1 || !aArg2 || !iReceiveMtm) return; CMsvEntrySelection* entries=(CMsvEntrySelection *)aArg1; TMsvId id=*(TMsvId*)aArg2; if (id != KMsvGlobalInBoxIndexEntryId) return; for (int i=0; i< entries->Count(); i++) { //handle_received(entries->At(i), id); } } break; */ case EMsvEntriesMoved: // this event is given when message entries are moved { // An entry has been moved to another parent // We are interested messages that have been moved to Sent folder if (!aArg1 || !aArg2 || !aArg3 ) return; TMsvId* toEntryId; TMsvId* fromEntryId; toEntryId = static_cast<TMsvId*>(aArg2); fromEntryId = static_cast<TMsvId*>(aArg3); CMsvEntrySelection* entries = static_cast<CMsvEntrySelection*>(aArg1); if ( *toEntryId == KMsvSentEntryId ) // the entry has been moved into Sent folder { // We take the moved entries into a selection //Process each created entry, one at a time. for(TInt i = 0; i < entries->Count(); i++) { DeleteSentEntry(entries->At(i)); // this checks the entry and deletes if it is created by GDSMS app //handle_sent(entries->At(i)); } } // for(TInt i = 0; i < entries->Count(); i++) // { //handle_moved(entries->At(i), *fromEntryId, *toEntryId); // } } break; /* case EMsvEntriesChanged: { if (!aArg1) return; CMsvEntrySelection* entries = static_cast<CMsvEntrySelection*>(aArg1); TMsvId* ParentFolder = static_cast<TMsvId*>(aArg2); // 'changed' event + Inbox folder = Read if (*ParentFolder == KMsvGlobalInBoxIndexEntryId ) { for(TInt i = 0; i < entries->Count(); i++) { //handle_read(entries->At(i)); } } else { for(TInt i = 0; i < entries->Count(); i++) { //handle_changed(entries->At(i)); } } } break; case EMsvEntriesDeleted: { if (!aArg1 || !aArg2) return; TMsvId* folderId; folderId = static_cast<TMsvId*>(aArg2); CMsvEntrySelection* entries = static_cast<CMsvEntrySelection*>(aArg1); for(TInt i = 0; i < entries->Count(); i++) { handle_deleted(entries->At(i), *folderId); } } break; */ default: break; } }
EXPORT_C TInt CMsvServerEntry::ChangeAttributes(const CMsvEntrySelection& aSelection, TUint aSetAttributes, TUint aClearAttributes) // // // /** Provides a quick way to set or clear multiple fields in a selection of entries. Fields to change are specified using a bitmask of TMsvAttribute values. Possible fields that can be changed using this function are: 1. PC synchronisation 2. Visibility flag 3. Read flag 4. In-preparation flag 5. Connected flag 6. New flag @param aSelection The entries to change @param aSetAttributes A bitmask of the fields to set @param aClearAttributes A bitmask of the fields to clear @return KErrNone if successful, otherwise one of the system-wide error codes. KErrNotFound if a specified entry does not exist. @see TMsvAttribute */ { __ASSERT_DEBUG(iEntry.Id()!=KMsvNullIndexEntryId, PanicServer(EMsvEntryWithNoContext11)); // only change children if (!AreChildren(aSelection)) return KErrNotFound; // get a copy of the selection CMsvEntrySelection* changedEntries=NULL; TRAPD(error, changedEntries = aSelection.CopyL()); if (error) return error; // lock all the selection TInt count1=aSelection.Count(); while (count1--) { error = iServer.IndexAdapter().LockEntry(aSelection.At(count1)); if (error) break; } // change the attributes if all were locked if (error==KErrNone) { error = iServer.IndexAdapter().ChangeAttributes(*changedEntries, aSetAttributes, aClearAttributes); } // release all that were locked TInt count2=aSelection.Count(); while (--count2>count1) { iServer.IndexAdapter().ReleaseEntry(aSelection.At(count2)); } // notify server if any have been changed if (error==KErrNone && changedEntries->Count()) iServer.NotifyChanged(EMsvEntriesChanged, *changedEntries, iEntry.Id()); delete changedEntries; return error; }
LOCAL_C void DoExecuteL() { CActiveScheduler* activeScheduler = new (ELeave) CActiveScheduler(); CleanupStack::PushL(activeScheduler); CActiveScheduler::Install(activeScheduler); // Create Session CSessionObserver* sessionObserver; sessionObserver = new (ELeave) CSessionObserver; CleanupStack::PushL(sessionObserver); CMsvSession* session = CMsvSession::OpenSyncL(*sessionObserver); CleanupStack::PushL(session); // Set the message entry to global Outbox folder CMsvEntry* msvEntry = session->GetEntryL(KMsvGlobalOutBoxIndexEntryId); CleanupStack::PushL(msvEntry); // Get the selection of Pigeon messages present in Outbox CMsvEntrySelection* selection = msvEntry->ChildrenWithMtmL(KUidMsgTypePigeon); CleanupStack::PushL(selection); // Schedule it to send immediately - use default settings. CMsvScheduleSettings* settings = CMsvScheduleSettings::NewL(); CleanupStack::PushL(settings); RScheduler scheduler; TSchedulerItemRef ref; CMsvScheduleSend::ConnectAndRegisterL(scheduler, *settings); CleanupClosePushL(scheduler); TInt selCount = selection->Count(); for( TInt index = 0; index < selCount; ++index ) { msvEntry->SetEntryL(selection->At(index)); if(msvEntry != NULL) { TMsvEntry entry = msvEntry->Entry(); ref.iHandle = KErrNotFound; FindOrCreateScheduleL(scheduler, entry.iDate, *settings, ref); User::LeaveIfError(scheduler.DisableSchedule(ref.iHandle)); TMsvSchedulePackage package; package.iPollProgress = 3000000; package.iCommandId = ESendScheduledL; package.iId = selection->At(index); TTaskInfo info; CMsvScheduleSend::ScheduleEntryL(scheduler, ref, package, info); User::LeaveIfError(scheduler.EnableSchedule(ref.iHandle)); } } CleanupStack::PopAndDestroy(7, activeScheduler); }
LOCAL_C void doMainL() { InitL(); TInt globalError = KErrNone; testUtils->FileSession().SetSessionPath(_L("c:\\")); testUtils->GoClientSideL(); testUtils->CreateSmtpServiceL(); pop3Service = testUtils->CreatePopServiceL(); testUtils->GoServerSideL(); testUtils->CreateMessageL(K_T_MIUT10_PLAIN_MSG, pop3Service, pop3Service); testUtils->CreateMessageL(K_T_MIUT10_PLAIN_MSG, pop3Service, pop3Service); testUtils->CreateMessageL(K_T_MIUT10_HTML_ATTACHMENT_MSG, pop3Service, pop3Service); test.Printf(_L("\nPerforming Cache Management Tests\n")); testUtils->GoClientSideL(); testUtils->iMsvEntry->SetEntryL(pop3Service); TMsvEntry entry = testUtils->iMsvEntry->Entry(); entry.SetVisible(ETrue); testUtils->iMsvEntry->ChangeL(entry); TRequestStatus observerStatus; CImCacheManager* cacheManager = CFilteredCacheManager::NewL(*testUtils->iMsvSession, observerStatus); CleanupStack::PushL(cacheManager); TestUiTimer* testUiTimer = TestUiTimer::NewLC(test.Console(), cacheManager); CTestActive* testActive = new (ELeave) CTestActive(); CleanupStack::PushL(testActive); testActive->StartL(); testUiTimer->IssueRequest(); testUtils->TestStart(0, K_T_MIUT10_DESCRIPTION); cacheManager->StartL(pop3Service, testActive->iStatus); CActiveScheduler::Start(); // DEF066273: rewrite-Messaging regression test T_MIUT10 failing consistently // DEF049479: is no longer valid it has therefore not been taken into consideration //ensure at correct service entry testUtils->iMsvEntry->SetEntryL(pop3Service); //store msg entires of this service CMsvEntrySelection* popEntrySelection; popEntrySelection=testUtils->iMsvEntry->ChildrenL(); CleanupStack::PushL(popEntrySelection); TInt count=popEntrySelection->Count(); TInt childEntries; TMsvId msgId; TMsvEntry msgEntry; TBuf<128> msgFail,msgPass; for(TInt i=0; i<count; ++i) { //ensure at correct location msgId=popEntrySelection->At(i); testUtils->iMsvEntry->SetEntryL(msgId); // testUtils->iMsvEntry->Entry(); //ensure that there are no more child entries childEntries=testUtils->iMsvEntry->Count(); if (childEntries!=0 && DONT_PRUNE_ID!=msgId) { //body text or attachments still exist msgFail.Format(K_T_MIUT10_MSG_NOT_PRUNED,msgId); testUtils->WriteComment(msgFail); globalError = KErrMsgNotPruned; } else { //email successfully-prunned header saved. msgPass.Format(K_T_MIUT10_MSG_PRUNED,msgId); testUtils->WriteComment(msgPass); } } testUtils->TestFinish(0, globalError); if (globalError == KErrNone) { testUtils->TestHarnessCompleted(); } else { testUtils->TestHarnessFailed(globalError); } CleanupStack::PopAndDestroy(4,cacheManager); // testActive, testUiTimer, cacheManager,popEntrySelection Closedown(); }
void CRoadmapNotifySMS::HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3) { switch (aEvent) { case EMsvServerReady: // We use OpenSyncL so do nothing here, // otherwise intialize m_pMsvEntry here if NULL break; case EMsvEntriesCreated: // Only look for changes in the Inbox if (aArg2 && *(static_cast<TMsvId*>(aArg2)) == KObservedFolderId) { CMsvEntrySelection* entries = static_cast<CMsvEntrySelection*>(aArg1); if( entries->Count() >= 1 ) { m_NewMessageId = entries->At(0); } else { roadmap_log(ROADMAP_ERROR, "SMS Engine Internal error");//Panic(ESmsEngineInternal); } } break; case EMsvEntriesChanged: //Look for changes. When using the emulator observed folder is //drafts, otherwise inbox. if (aArg2 && *(static_cast<TMsvId*>(aArg2)) == KObservedFolderId) { CMsvEntrySelection* entries = static_cast<CMsvEntrySelection*>(aArg1); if( entries->Count() < 1 ) { roadmap_log(ROADMAP_ERROR, "SMS Engine Internal error"); //Panic(ESmsEngineInternal); } else if (m_NewMessageId == entries->At(0)) { /* * it's initialized after OpenSyncL; use code below only if async if( !m_pMsvEntry ) { roadmap_log(ROADMAP_ERROR, "SMS Engine not initialized"); //Panic(ESmsEngineNotInitialized); return; } */ // Set entry context to the new message m_pMsvEntry->SetEntryL(m_NewMessageId); // Check the type of the arrived message and that the // message is complete. // only SMS's are our consern. if ( m_pMsvEntry->Entry().iMtm != KUidMsgTypeSMS || !m_pMsvEntry->Entry().Complete() ) { return; } //TODO call m_pSmsReceivedCallback here } } break; default: break; } }