convert users of IsSpecialFolder(folder, ...) over to use folder.isSpecialFolder(...)

RESOLVED FIXED in Thunderbird 3.0b4


9 years ago
9 years ago


(Reporter: Magnus Melin, Assigned: Magnus Melin)


Thunderbird 3.0b4

Firefox Tracking Flags

(Not tracked)



(2 attachments)



9 years ago
Created attachment 390746 [details] [diff] [review]
proposed fix

Since bug 412690 we have a folder method isSpecialFolder which matches the IsSpecialFolder() method we had before. 

This bug removes the js IsSpecialFolder() method.
Attachment #390746 - Flags: superreview?(neil)
Attachment #390746 - Flags: review?(bugmail)
Comment on attachment 390746 [details] [diff] [review]
proposed fix

on file: mail/base/content/msgViewNavigation.js line 84
>       let flags = nsMsgFolderFlags.Trash | nsMsgFolderFlags.SentMail |
>                   nsMsgFolderFlags.Drafts | nsMsgFolderFlags.Queue |
>                   nsMsgFolderFlags.Templates | nsMsgFolderFlags.Junk;
>       if (!folder.isSpecialFolder(flags, true)) {

If you are going to introduce a temporary for readability, the temporary
should probably have an appropriate name.  ignoreTrashJunkOrOutgoingFlags
seems like an explanation of that flag set..  You can also hoist the temporary
outside the loop so that there's a better reason for the temporary.  You will
need to hoist the nsMsgFolderFlags constant at the same time.

on file: mail/base/content/phishingDetector.js line 112
>       let flags = nsMsgFolderFlags.SentMail | nsMsgFolderFlags.Drafts |
>                   nsMsgFolderFlags.Templates | nsMsgFolderFlags.Queue;
>       if (folder.isSpecialFolder(flags, true))

This temporary could be outgoingFolderFlags.
Attachment #390746 - Flags: review?(bugmail) → review+

Comment 2

9 years ago
Comment on attachment 390746 [details] [diff] [review]
proposed fix

I think it might be nice to define extra constants in nsMsgFolderFlags.idl for these frequently used combinations e.g. a) outgoing folders b) non-navigated folders.

>   // if this is the drafts, sent, or send later folder,
>   // we show "Recipient" instead of "Author"
>   const nsMsgFolderFlags = Components.interfaces.nsMsgFolderFlags;
>-  SetSentFolderColumns(IsSpecialFolder(newFolder, nsMsgFolderFlags.SentMail | nsMsgFolderFlags.Drafts | nsMsgFolderFlags.Queue, true));
[Not sure why we don't have Templates here, but I don't know where the Thunderbird equivalent of this is, or was.]
Attachment #390746 - Flags: superreview?(neil) → superreview+

Comment 3

9 years ago
Yeah seems like Templates should be there. Added.

changeset:   3155:3473dd892063

Last Resolved: 9 years ago
Resolution: --- → FIXED

Comment 4

9 years ago
(In reply to comment #3)
> Yeah seems like Templates should be there. Added.
I don't see it in the changeset. I also like your ignoreFlags and outgoingFlags names. A pity you missed two occurrences of bare "flags" in suite/mailnews :-(

Comment 5

9 years ago
Created attachment 391326 [details] [diff] [review]
proposed fix (part2)

Wonder if i forgot to refresh...

Comment 6

9 years ago
changeset:   3179:d9097b2ec83a
You need to log in before you can comment on or make changes to this bug.