User:Rkentjames:Bug116181

From MozillaWiki
Jump to: navigation, search

Here I will collect my understanding of how the new mail counts and flags work, and how they relate to BIFF.

Concept summaries

Get/Set NumNewMessages

These routines in nsMsgDBFolder operate on the mNumNewBiffMessages variable. This is not the same as the number of messages in a folder that has the flag MsgFlagNew set. Confused? So am I!

When a message is received from a server, then SetNumNewMessages is called to add the new messages. But the same thing is done in Virtual folder listeners, where the intention is clearly to track the number of messages with the new flag set.

Currently, PerformBiffNotification relies on GetNumNewMessages > 0 to decide to do Biff Notification. That makes sense, we don't want to do notification if counts have been set to zero by, say, junk mail processing. So we need to reset the counts at notification.

BiffState

Filter-driven notification

Bug 11040 requests that Biff notification be done using a filter. How to make this work? The folder needs to track the NumNewBiffMessages concept. A filter action to PerformBiffNotification would be easy enough to add.

Proposals

  1. Add a new variable nNumNewMessages that tracks the number of messages in a folder with the new flag set

Bugs this may affect