Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to get all messages (headers) in folder or scan through them
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Expand all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Teemu Hautala  
View profile  
 More options Apr 22 2009, 7:08 pm
Newsgroups: mozilla.dev.extensions
From: Teemu Hautala <teemu.haut...@gmail.com>
Date: Thu, 23 Apr 2009 02:08:40 +0300
Local: Wed, Apr 22 2009 7:08 pm
Subject: How to get all messages (headers) in folder or scan through them
Hi,

Once again, I hit a kind of a brick wall... How could I go through all
the messages in a given Thunderbird message folder, namely I want to
process their headers (not only new/unread messages, but all of them).

I am developing an extension which will sort and gather information
about messages, but currently it only processes messages which are
received while TB is running. I need functionality to scan for new
messages at startup, and manually scan a folder initiated by user. As a
starting point I just have the nsIMsgFolder element.

nsIMsgFolder has a method getMessages(), but I'm not sure what it
actually does or how you're supposed to use it. Didn't find any good
reference for it so far. Or should I use the search functionality somehow?

Thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Teemu Hautala  
View profile  
 More options Apr 22 2009, 7:56 pm
Newsgroups: mozilla.dev.extensions
From: Teemu Hautala <teemu.haut...@gmail.com>
Date: Thu, 23 Apr 2009 02:56:48 +0300
Local: Wed, Apr 22 2009 7:56 pm
Subject: Re: How to get all messages (headers) in folder or scan through them

Teemu Hautala wrote:
> Hi,

> Once again, I hit a kind of a brick wall... How could I go through all
> the messages in a given Thunderbird message folder, namely I want to
> process their headers (not only new/unread messages, but all of them).

And again, managed to get the getMessages() work just little after
sending a message:

iMessages = aFolders[0].getMessages(null); // get the messages

while(iMessages.hasMoreElements()) {
   var iHdr =
iMessages.getNext().QueryInterface(Components.interfaces.nsIMsgDBHdr);
    // doing something with the hdr
   }

Now just have some issues with timing or variable scope, because that
while loop only succeeds to process the first message... but I guess
that will be solved tomorrow, hopefully.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »