// ----------------------------------------------------------------------------- // CCbsTopicMessages::HandleRequestsL // Handle the requests for the object. // Passes requests to proper functions // (other items were commented in a header). // ----------------------------------------------------------------------------- // TBool CCbsTopicMessages::HandleRequestsL( const RMessage2& aMessage ) { CBSLOGSTRING("CBSSERVER: >>> CCbsTopicMessages::HandleRequestsL()"); TBool requestHandled ( ETrue ); // Handle the requests that are for the subsession. switch ( aMessage.Function() ) { case ECbsCloseTopicMessagesSubsession: CloseTopicMessages(); aMessage.Complete( KErrNone ); break; case ECbsGetMessageCount: GetMessageCountL(); break; case ECbsGetMessage: GetMessageL(); break; case ECbsFindMessageByHandle: FindMessageByHandleL(); break; case ECbsGetMessageIndexByHandle: GetMessageIndexByHandleL(); break; case ECbsGetNextAndPrevMsgHandle: GetNextAndPrevMsgHandleL(); break; case ECbsDeleteMessage: DeleteMessageL( iReceiver ); break; case ECbsSaveMessage: SaveMessageL( iReceiver ); break; case ECbsLockMessage: LockMessageL(); break; case ECbsReadMessage: ReadMessageL( iReceiver ); break; case ECbsGetMessageContents: GetMessageContentsL(); break; default: requestHandled = EFalse; break; } CBSLOGSTRING2("CBSSERVER: <<< CCbsTopicMessages::HandleRequestsL(), returning requestHandled: %d", requestHandled ); return requestHandled; }
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 CLocaLogicImpl::GetMessage(const CBBBtDeviceList* devices, const TTime& aAtTime, TInt& doSendToIndex, TInt& aMessageCode, TDes& aWithName, TDes& aWithTitle, auto_ptr<HBufC8>& aBody) { CC_TRAPD(err, GetMessageL(devices, aAtTime, doSendToIndex, aMessageCode, aWithName, aWithTitle, aBody)); }
/** Tells the scheduler that sending is complete. This method sets the messages's scheduled flag to false, resets the schedule data associated with each message and the number of retries for each recipient and stores the data and recipients in a stream associated with the TMsvEntry. @param aSelection Messages that were either successfully sent or which failed all the attempts to send. */ EXPORT_C void CMsvScheduleSend::SendingCompleteL(const CMsvEntrySelection& aSelection) { TInt count = aSelection.Count(); while (count--) { CMsvScheduledEntry* schEntry = GetMessageL(aSelection[count]); CleanupStack::PushL(schEntry); SendingCompleteL(*schEntry, ETrue); CleanupStack::PopAndDestroy(); //schEntry } }
/** Tells the scheduler that sending is complete. This function must be called when a message that had previously been scheduled is either sent or has failed. This function: 1. Deletes the TMsvEntryScheduleData associated with the message 2. Sets the Scheduled flag to EFalse 3. If required, calls ChangeEntry() on the message server entry Note: SendingCompleteL() does not change the sending state of each message, nor delete each message from the task scheduler. @param aEntry The message which was either successfully sent or which failed (all the attempts) to send. It is not a precondition that the message has already been scheduled on the task scheduler. @param aChangeEntry If aChangeEntry is ETrue then SendingCompleteL() will call CMsvServerEntry::ChangeEntry() to update the message on the message server. @panic ScheduleSend-DLL 24 The server entry is not set to the correct entry. Debug build only. */ EXPORT_C void CMsvScheduleSend::SendingCompleteL(TMsvEntry& aEntry, const TBool aChangeEntry) { __ASSERT_DEBUG(iServerEntry.Entry().Id() == aEntry.Id(), gPanic(EServerEntryNotSetToCorrectEntry)); CMsvScheduledEntry* schEntry = GetMessageL(aEntry.Id()); CleanupStack::PushL(schEntry); SendingCompleteL(*schEntry, EFalse); schEntry->Entry(aEntry); if (aChangeEntry) { User::LeaveIfError(iServerEntry.ChangeEntry(aEntry)); } CleanupStack::PopAndDestroy(); //schEntry }