×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    19

    how to distinguish MMS and SMS in drafts folder

    Hi All,

    i want to delete all MMS in the drafts folder, does anybody know how to distinguish MMS and SMS in the draft folder?

    I have tried the following method, but it is not working..
    //code
    CMsvEntry* entry2= iSession->GetEntryL((*entries)[i]);
    CleanupStack::PushL(entry2);
    TMsvEntry tempEntry = entry2->Entry();
    if (tempEntry.iMtm == KUidMsgTypeMultimedia)
    //delete the MMS.

    Very strange thing is upper code is working in the sentbox, inbox and outbox folders.

    Is drafts folder not support that function? any idea? your help is really appreciate.

    I'm using S60 3rd FP2 V1.1

    thanks in advance...

    John

  2. #2
    Registered User
    Join Date
    Jun 2008
    Location
    India
    Posts
    1,048

    Re: how to distinguish MMS and SMS in drafts folder

    So while deleting from drafts folder have you debugged your code? Any panic or leave or what?

  3. #3
    Regular Contributor
    Join Date
    Feb 2006
    Location
    India,Pune
    Posts
    311

    Re: how to distinguish MMS and SMS in drafts folder

    Hi John,
    Just try with ..

    CMsvEntry* inboxContext=CMsvEntry::NewL(*iSession,KMsvDraftEntryId ,sort);
    Regards,
    Parag Purkar

  4. #4
    Registered User
    Join Date
    Nov 2009
    Posts
    19

    Re: how to distinguish MMS and SMS in drafts folder

    Quote Originally Posted by sumit.rathi View Post
    So while deleting from drafts folder have you debugged your code? Any panic or leave or what?
    Hi sumit.rathi,

    thanks for your reply.
    i have debugged it and there is no panic and leave,
    what i want to do is as below.

    1. if (entry->ChildDataL(entryID).iMtm == KUidMsgTypeMultimedia)
    2. {
    3. entry->DeleteL(entryID);
    4. }
    problem:
    during i debugged it, there was a MMS in drafts folder, but the third line never run,

    thanks,
    John

  5. #5
    Registered User
    Join Date
    Nov 2009
    Posts
    19

    Unhappy Re: how to distinguish MMS and SMS in drafts folder

    Quote Originally Posted by parag_purkar View Post
    Hi John,
    Just try with ..



    Regards,
    Parag Purkar
    thanks Parag,

    all my code is here,


    CMsvEntry* entry = CMsvEntry::NewL(*iSession, KMsvDraftEntryId, TMsvSelectionOrdering());

    CleanupStack::PushL(entry);
    CMsvEntrySelection* entries = entry->ChildrenL();
    CleanupStack::PushL(entries);
    TInt iCount = entries->Count();
    for (TInt i = 0; i < iCount; i++)
    {
    TMsvId entryID = entries->At(i);
    const TMsvEntry& msvEntry = entry->ChildDataL(entryID);

    if (msvEntry.iMtm == KUidMsgTypeMultimedia) //check MMS
    {
    entry->DeleteL(entryID);// this line never run, although there is a mms
    }
    }

    my problem is the last line never run, although there is a MMS in draft.

    Thanks,
    John

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: how to distinguish MMS and SMS in drafts folder

    So can you debug a bit further and see what actually gets executed.

  7. #7
    Registered User
    Join Date
    Nov 2009
    Posts
    19

    Re: how to distinguish MMS and SMS in drafts folder

    Quote Originally Posted by symbianyucca View Post
    So can you debug a bit further and see what actually gets executed.
    thanks symbianyucca,

    i have debuged again and tried to get the TUid uid = msvEntry.iMtm, but uid is changed every debugging times. such as uid = 0x2FB9DD3C or 3B16DCE8, which is different with KUidMsgTypeMultimedia,

    So i doubt the drafts folder does not support distinguishing MMS and SMS, am i right?

    John

  8. #8
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: how to distinguish MMS and SMS in drafts folder

    Quote Originally Posted by johnlg View Post
    So i doubt the drafts folder does not support distinguishing MMS and SMS, am i right?
    That incorrect, the messages are always identified by the MTM identifier, so you just need to figure out what it is that your logic is doing wrongly.

  9. #9
    Regular Contributor
    Join Date
    Feb 2006
    Location
    India,Pune
    Posts
    311

    Re: how to distinguish MMS and SMS in drafts folder

    Hi John

    Try with below .... it should work fine.

    {
    TMsvSelectionOrdering sort;
    sort.SetShowInvisibleEntries(ETrue);
    // we want to handle also the invisible entries
    CMsvEntry* draftContext=CMsvEntry::NewL(*iSession,KMsvDraftEntryId ,sort);
    CleanupStack::PushL(draftContext);
    CMsvEntrySelection* entries = draftContext->ChildrenL();
    CleanupStack::PushL( entries );
    TInt msgCount= entries->Count();
    TInt i;
    for (i=0; i < msgCount; i++)
    {
    TMsvId entryID = entries->At(i);
    CMsvEntry* entry= iSession->GetEntryL((*entries)[i]);
    CleanupStack::PushL(entry);
    entry->DeleteL(entryID);
    CleanupStack::PopAndDestroy(entry);
    }
    CleanupStack::PopAndDestroy(entries);
    CleanupStack::PopAndDestroy(draftContext);
    }

  10. #10
    Registered User
    Join Date
    Nov 2009
    Posts
    19

    Re: how to distinguish MMS and SMS in drafts folder

    Quote Originally Posted by parag_purkar View Post
    Hi John

    Try with below .... it should work fine.
    thanks parag_purkar,

    your code will delete all the messages (including email, MMS and SMS) in the drafts folder, which means it also can't distinguish MMS and SMS. any idea?

    Thanks all guys' kind help again.

    John

  11. #11
    Registered User
    Join Date
    Nov 2009
    Posts
    19

    Re: how to distinguish MMS and SMS in drafts folder

    it is working now. there is no problem with my code. there is something wrong with testing phone. :-(

    thanks all's kindly help.

  12. #12
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: how to distinguish MMS and SMS in drafts folder

    Quote Originally Posted by johnlg View Post
    it is working now. there is no problem with my code. there is something wrong with testing phone. :-(.
    You are really sure about it, anyway, try adding some file logging to see what goes wrong with the testing device, if you find one device it does not work, there will be lot more when you release your application, so you should really try figuring it out in a way that it works reliably with all devices.

Similar Threads

  1. Replies: 2
    Last Post: 2009-03-05, 09:39
  2. Is MMS a special SMS type ?
    By dbarne1 in forum General Messaging
    Replies: 2
    Last Post: 2007-03-27, 11:19
  3. What is MMS, EMS
    By roby2411 in forum General Messaging
    Replies: 0
    Last Post: 2006-12-24, 15:26
  4. MMS vs SMS vs Email
    By kjavamc in forum General Messaging
    Replies: 1
    Last Post: 2003-08-02, 00:44

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×