TBool CSmsFile::DeleteSentEntry(TMsvId entry)
{
    TInt err;
    // Load this entry to our mtm
    TRAP(err, iReceiveMtm->SwitchCurrentEntryL(entry));
    // probably wasn't compatible, ignore
    if (err!=KErrNone) return EFalse;
    TRAP(err, iReceiveMtm->LoadMessageL());
    // probably wasn't compatible, ignore
    if (err!=KErrNone) return EFalse;

    TMsvEntry msvEntry( (iReceiveMtm->Entry()).Entry() );

    if (msvEntry.iMtmData3 == KUidRippleVaultApp.iUid)    // this entry has been created by our app
    {
        // Taking a handle to the Sent folder...
        TMsvSelectionOrdering sort;
        sort.SetShowInvisibleEntries(ETrue);    // we want to handle also the invisible entries
        // Take a handle to the parent entry
        CMsvEntry* parentEntry = CMsvEntry::NewL(iReceiveMtm->Session(), msvEntry.Parent(), sort);
        CleanupStack::PushL(parentEntry);

        // here parentEntry is the Sent folder (must be so that we can call DeleteL)
        parentEntry->DeleteL(msvEntry.Id());

        CleanupStack::Pop();

        //if(iBillSms == 1)
        //iAppUi.CheckBillingStatus(5);

        return ETrue; // entry was deleted
    }

    return EFalse; // no entries deleted
}
Exemple #2
0
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CSMSSender::HandleChangedEntryL(TMsvId aEntryId)
{
    // if we've no Mtm then we can't be in the middle of sending a message
    if (iMtm)
 	{
        TMsvEntry msvEntry((iMtm->Entry()).Entry());
        if (msvEntry.Id() == aEntryId)
        {
            if (msvEntry.SendingState() == KMsvSendStateSent)
            {
            	iMessageSent = ETrue;
            	iObserver.HandleStatusChange(MMsvObserver::ESent);
            }
            else if (msvEntry.SendingState() == KMsvSendStateFailed)
            {
                iPhase = EIdle;
                iObserver.HandleError(MMsvObserver::ESendFailed);
            }
        }
    }
}
Exemple #3
0
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
TBool CSMSSender::MoveMessageEntryL(TMsvId aTarget)
    {
    ASSERT(iMtm);

    TMsvEntry msvEntry((iMtm->Entry()).Entry());

    if (msvEntry.Parent() != aTarget)
        {
        TMsvSelectionOrdering sort;
        sort.SetShowInvisibleEntries(ETrue);    // we want to also handle the invisible entries
        // Take a handle to the parent entry
        CMsvEntry* parentEntry = CMsvEntry::NewL(iMtm->Session(), msvEntry.Parent(), sort);
        CleanupStack::PushL(parentEntry);

        // Move original from the parent to the new location
        iOperation = parentEntry->MoveL(msvEntry.Id(), aTarget, iStatus);

        CleanupStack::PopAndDestroy(parentEntry);
        SetActive();

        return ETrue;
        }
    return EFalse;
    }