User:Rkentjames:Bug116181: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(New page: Having investigated the multiple problems with new counts, I have the following proposal: - in nsMsgDatabase, the message flag nsMsgHdr->m_flags is the authority for all purposes except g...)
 
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
Having investigated the multiple problems with new counts, I have the following proposal:
Here I will collect my understanding of how the new mail counts and flags work, and how they relate to BIFF.


- in nsMsgDatabase, the message flag nsMsgHdr->m_flags is the authority for all purposes except getting the next first message. For that, use the m_newSet
== Concept summaries ==


- all calls to nsMsgDatabase that affect the new flag, including either changes to the flag directly or adding it to the list, will attempt to maintain both the message flag, as well as the new list.
=== Get/Set NumNewMessages ===


- any attempts that fail to add a message header to m_newSet will add and resort.
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 ==
 
# Add a new variable nNumNewMessages that tracks the number of messages in a folder with the new flag set


== Bugs this may affect ==
== Bugs this may affect ==

Latest revision as of 07:51, 17 June 2008

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