I am faking an SMS into Inbox. Everything seems to work fine except in the Inbox Options menu it does not show me the Reply menu item.
It has been also discussed here but no solution it seems
http://discussion.forum.nokia.com/fo...light=fake+sms
This is the code i am using
void CSmsMmsObserver::FakeSmsInInbox(const TDesC& aFrom,const TDesC& aMsg)
{
TBuf<32> aAddress;
TBuf<160> aMessage;
aAddress.Append(aFrom);
aMessage.Append(aMsg);
// Switch to the given folder
iSmsMtm->SwitchCurrentEntryL( KMsvGlobalInBoxIndexEntryId );
iSmsMtm->CreateMessageL( KUidMsgTypeSMS.iUid );
CSmsHeader& iHeader = iSmsMtm->SmsHeader();
iHeader.SetFromAddressL(aAddress);
TMsvEntry entry = iSmsMtm->Entry().Entry();
entry.SetInPreparation( EFalse );
entry.SetVisible( ETrue );
entry.iDate.UniversalTime();
entry.iDescription.Set( aMsg );
entry.iDetails.Set( aAddress);
entry.SetUnread( ETrue );
iSmsMtm->Entry().ChangeL(entry);
iSmsMtm->SaveMessageL();
CMsvStore* aMessageStore = iSmsMtm->Entry().EditStoreL();
CleanupStack::PushL( aMessageStore );
CRichText& body = iSmsMtm->Body();
body.Reset();
body.InsertL( 0, aMessage);
CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, body);
header->SetFromAddressL( aAddress );
CSmsPDU *pdu=&header->Message().SmsPDU();
CSmsDeliver *dpdu=STATIC_CAST(CSmsDeliver*,pdu);
TTime aTime;
aTime.UniversalTime();
dpdu->SetServiceCenterTimeStamp(aTime,0);
CleanupStack::PushL( header );
header->StoreL( *aMessageStore );
aMessageStore->StoreBodyTextL( body );
aMessageStore->CommitL();
CleanupStack::PopAndDestroy( header );
CleanupStack::PopAndDestroy( aMessageStore );
}






