Closed Bug 476103 Opened 15 years ago Closed 15 years ago

Need Gloda.getMessageCollectionForHeaders

Categories

(MailNews Core :: Database, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.0b3

People

(Reporter: davida, Assigned: asuth)

References

Details

(Whiteboard: [need asuth to pick a word and push])

Attachments

(1 file, 2 obsolete files)

getMessageCollectionForHeader is a nice function that given a msgHdr, returns a collection for it, which makes it easy to access glodish things about messages, and notifications on updates.  It's not very efficient, though, and doesn't work with collections of messages.

It'd be nice to have a getMessageCollectionForHeaders which 
 - accepted lists of msgHdrs
 - cached things intelligently

please & thank you.
Flags: blocking-thunderbird3+
Attached patch v1 messages for headers (obsolete) — Splinter Review
Try this.
Attachment #361871 - Attachment is obsolete: true
I have added a unit test for the new function (getMessageCollectionForHeaders) as well as its already single friend (getMessageCollectionForHeader).

One notable change outside of gloda is that fixIterator has been augmented to accept JS arrays and iterators as valid inputs, making it even more convenient and useful.
Attachment #363428 - Attachment is obsolete: true
Attachment #363441 - Flags: superreview?(bienvenu)
Attachment #363441 - Flags: review?(bienvenu)
Attachment #363441 - Flags: superreview?(bienvenu)
Attachment #363441 - Flags: superreview+
Attachment #363441 - Flags: review?(bienvenu)
Attachment #363441 - Flags: review+
Comment on attachment 363441 [details] [diff] [review]
v3 messages for headers.  working unit test, enhancement to fixIterator.

need a noun in the phrase "or up a new one" - cons ? :-)

+      // if this is the first or clause, just use the query itself
+      if (!clause)
+        clause = query;
+      else // or up a new one
+        clause = query.or();
Whiteboard: [need asuth to pick a word and push]
While I stand by my cool phrasing as cool, I have rephrased the comment in question to mentally parse more easily.

pushed http://hg.mozilla.org/comm-central/rev/ef056fd8ebbf
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.