Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Regular Contributor gpalvia's Avatar
    Join Date
    Mar 2004
    Posts
    154
    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 );
    }

  2. #2
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    You can try including a 'traditional' CSmsClientMtm::AddAddresseeL somewhere.

  3. #3
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    Quote Originally Posted by gpalvia View Post
    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 );
    }
    This normally happens when your SMS does not contact address field.

  4. #4
    Regular Contributor gpalvia's Avatar
    Join Date
    Mar 2004
    Posts
    154
    The strange thing is that when i open the SMS i can see the Reply menu item. But in the Inbox view the Reply menu item is not seen.

    Let me try the CSmsClientMtm::AddAddresseeL approach.

    Will update by tomorrow with the result.

  5. #5
    Nokia Developer Champion savaj's Avatar
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034
    Hi,

    whenever i try to fake SMS in my inbox, SMS goes to inbox but when i open menu it show forward instead of reply, And when i open "Message Details" menu it shows me following details:

    subject:abc
    Date:01/10/2008
    Time:12:35 am
    Type: Text message
    To: xyz <9912345678> //here its supposed to be from not to.

    How to resolve this problem???

    thanks in advance.

  6. #6
    Nokia Developer Champion savaj's Avatar
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034
    Hi,

    issue resolved.

  7. #7
    Regular Contributor tcalamawy's Avatar
    Join Date
    Mar 2006
    Posts
    92
    Quote Originally Posted by savaj View Post
    Hi,

    issue resolved.
    So how is this resolved? It would be useful to others if you post the solution to the original problem. I'm assuming the SmsPdu may have to be changed to SMS-DELIVER, (sent from SC to MS)?

  8. #8
    Regular Contributor tcalamawy's Avatar
    Join Date
    Mar 2006
    Posts
    92
    Well, searching around it seems I would need to create the ESmsDeliver header. Of course, another roadblock... Now the lib needed isn't part of the SDK. I really think this is ridiculous, how much is necessary to accomplish this...

    CSmsHeader* hdr = CSmsHeader::NewL( CSmsPDU::ESmsDeliver, body );

  9. #9
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    Do not worry, despite what the SDK Help says, smcm.lib is actually present in the SDK-s.

  10. #10
    Regular Contributor tcalamawy's Avatar
    Join Date
    Mar 2006
    Posts
    92
    Quote Originally Posted by wizard_hu_ View Post
    Do not worry, despite what the SDK Help says, smcm.lib is actually present in the SDK-s.
    Thanks, yes I can compile. I'm nearly there... Message details shows "From:" now instead of "To:", but still no reply option. Looks like I missing something else?

  11. #11
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    Do you invoke SetToFromAddressL?

  12. #12
    Regular Contributor tcalamawy's Avatar
    Join Date
    Mar 2006
    Posts
    92
    Quote Originally Posted by wizard_hu_ View Post
    Do you invoke SetToFromAddressL?
    I'm doing the following, from what I see CSmsHeader SetFromAddressL will call SetToFromAddressL, right?

    Code:
    CSmsHeader* newHeader = CSmsHeader::NewL(CSmsPDU::ESmsDeliver, body);
       CleanupStack::PushL( newHeader );
       
       newHeader->SetFromAddressL( aFromAddress );
       newHeader->SetServiceCenterAddressL(aServiceCenterAddress);
       newHeader->Deliver().SetServiceCenterTimeStamp(aTime);
       newHeader->StoreL( *messageStore );
       messageStore->CommitL();

  13. #13
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    Unfortunately I do not know that for sure. And there is also the "common" AddAddresseeL. Do you use it?

  14. #14
    Regular Contributor tcalamawy's Avatar
    Join Date
    Mar 2006
    Posts
    92
    Quote Originally Posted by wizard_hu_ View Post
    Unfortunately I do not know that for sure. And there is also the "common" AddAddresseeL. Do you use it?
    Yes I do use smsMtm->AddAddresseeL(aFromAddress) followed by smsMtm->SaveMessageL()...

    I searched, and other posts also have the same problem. If someone knows how to get the reply menu option to appear when viewing the message list (reply appears when viewing the sms), please post it.

    Thanks!

  15. #15
    Regular Contributor elviin's Avatar
    Join Date
    Jul 2008
    Posts
    416
    Quote Originally Posted by tcalamawy View Post
    Yes I do use smsMtm->AddAddresseeL(aFromAddress) followed by smsMtm->SaveMessageL()...

    I searched, and other posts also have the same problem. If someone knows how to get the reply menu option to appear when viewing the message list (reply appears when viewing the sms), please post it.

    Thanks!
    Hello, I found this thread right now. I also added smsMtm->AddAddresseeL method already but there is still missing the reply in options. What I should call to fix this? Thank you.

Page 1 of 2 12 LastLast

Similar Threads

  1. How to fake a normal SMS to inbox?
    By luandao2000 in forum Symbian Networking & Messaging (Closed)
    Replies: 7
    Last Post: 2011-04-23, 08:26
  2. why it is moving only last sms in inbox?......
    By bharats in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2010-11-24, 09:11
  3. Replies: 2
    Last Post: 2007-11-10, 13:19
  4. adding menu item in Inbox using MTM
    By gpalvia in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2007-09-17, 14:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved