The default bug view has changed. See this FAQ.

gloda should allow search of mail folder types added by extensions

RESOLVED FIXED in Thunderbird 17.0

Status

MailNews Core
Search
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: rkent, Assigned: rkent)

Tracking

Trunk
Thunderbird 17.0
x86_64
Windows 7
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Comment hidden (empty)
(Assignee)

Comment 1

5 years ago
In index_msg.js we have the following code:
  shouldIndexFolder: function(aMsgFolder) {
    let folderFlags = aMsgFolder.flags;
    if (!(folderFlags & Ci.nsMsgFolderFlags.Mail) ||
        (folderFlags & Ci.nsMsgFolderFlags.Virtual))
      return false;
    if (!(aMsgFolder instanceof nsIMsgLocalMailFolder) &&
        !(aMsgFolder instanceof nsIMsgImapMailFolder))
      return false;

This hard-wires gloda to only support existing folder types, local and imap. But mail folder types added by an extension should also be searchable. The real reason for the "instanceof" checks here is to make sure that RSS folders (which derive from nsIMsgLocalFolder) are not searched. I propose to add an explicit check for rss type here rather than prevent other mail folders (who are correctly setting their Ci.nsMsgFolderFlags.Mail flag, unlike rss!) from also being searched.

This is similiar to the check that is added in newMailNotificationService:


169     // If it's not a mail folder we don't count it by default
170     if (!(aFolder.flags & Ci.nsMsgFolderFlags.Mail))
171       shouldCount.data = false;
172 
173     // For whatever reason, RSS folders have the 'Mail' flag
174     else if ((srv = aFolder.server) && (srv.type == "rss"))
175       shouldCount.data = false;
Sounds good.
(Assignee)

Comment 3

5 years ago
After I reread my comment 1, I realized that was incorrect. In fact, rss passes both tests, and gets true from shouldIndexfolder.

After IRC discussions with asuth, we could not establish a case where the instanceof checks catch anything in normal operation, so the patch will simply remove those tests.
(Assignee)

Comment 4

5 years ago
Created attachment 651018 [details] [diff] [review]
Don't check folder type
Assignee: nobody → kent
Status: NEW → ASSIGNED
Attachment #651018 - Flags: review?(bugmail)
Attachment #651018 - Flags: review?(bugmail) → review+
(Assignee)

Comment 5

5 years ago
Comment on attachment 651018 [details] [diff] [review]
Don't check folder type

Checked in http://hg.mozilla.org/comm-central/rev/6a59dd8ee39f
(Assignee)

Updated

5 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 17.0
You need to log in before you can comment on or make changes to this bug.