
Originally Posted by
lilyaaa
SO, What can I do? Could anyone successfully do that?
Odota. I just did it. Add the following case in your HandleSessionEventL function.
Code:
case EMsvEntriesMoved:
{
// Entry id is obtained from the session event arguments.
TMsvId* entryId = STATIC_CAST( TMsvId*, aArg2 );
// We are interested in messages that are moved to Sent Item Folder
if (*entryId == KMsvGlobalOutBoxIndexEntryId)
{
TMsvSelectionOrdering sort;
sort.SetSorting(EMsvSortByDateReverse);
sort.SetShowInvisibleEntries(ETrue); // we want to handle also the invisible entries
CMsvEntry* parentEntry = CMsvEntry::NewL(*iSession,
KMsvGlobalOutBoxIndexEntryId, sort);
CleanupStack::PushL(parentEntry);
CMsvEntrySelection* entries = parentEntry->ChildrenL();
CleanupStack::PushL(entries);
for (TInt i = 0; i < entries->Count(); i++)
{
if (parentEntry->ChildDataL(entries->At(i)).iMtmData3
!= KUidMsgTypeSMS.iUid)
{
TMsvEntry entry = parentEntry->ChildDataL(entries->At(i));
const TDesC& descp = entry.iDescription; // iDescription will have only first 32 characters from the message
TBufC<50> text(entry.iDetails);
parentEntry->DeleteL(entries->At(i));
break;
}
}
CleanupStack::PopAndDestroy(entries);
CleanupStack::PopAndDestroy(parentEntry);
}
break;
}