The default bug view has changed. See this FAQ.

Don't set the offline folder flag for SPAM and TRASH folders

RESOLVED FIXED in Thunderbird 22.0

Status

MailNews Core
Networking: IMAP
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: rkent, Assigned: Magnus Melin)

Tracking

(Blocks: 1 bug)

Trunk
Thunderbird 22.0
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
In setting up an initial Gmail account, both the SPAM and TRASH folders have the "use offline" flag set. We should not be downloading messages by default for these folders. The "use offline" should match whatever the gloda defaults are for which folders to index.

Updated

4 years ago
Blocks: 402793
(Assignee)

Updated

4 years ago
OS: Windows 7 → All
Hardware: x86_64 → All
(Assignee)

Updated

4 years ago
Assignee: nobody → mkmelin+mozilla
(Assignee)

Comment 1

4 years ago
Created attachment 706857 [details] [diff] [review]
proposed fix

Successful try run here: https://tbpl.mozilla.org/?tree=Thunderbird-Try&rev=c66481282cbf
(Assignee)

Updated

4 years ago
Attachment #706857 - Flags: review?(mozilla)
(Assignee)

Updated

4 years ago
Attachment #706857 - Flags: review?(mozilla) → review?(irving)
Comment on attachment 706857 [details] [diff] [review]
proposed fix

Review of attachment 706857 [details] [diff] [review]:
-----------------------------------------------------------------

I'm OK with this being checked in with the comments fixed; if you decide to change the NS_ENSURE_SUCCESS please send it back to me for a quick re-review.

::: mailnews/imap/src/nsImapMailFolder.cpp
@@ +968,5 @@
> +      // not always the case.
> +      uint32_t flags = 0;
> +      child->GetFlags(&flags);
> +
> +      // Make the newly created folder is flagged for offline use if the

Wording:

// Set the offline use flag for the newly created folder if the

@@ +969,5 @@
> +      uint32_t flags = 0;
> +      child->GetFlags(&flags);
> +
> +      // Make the newly created folder is flagged for offline use if the
> +      // offline_download prefis true, unless it's the Trash or Junk folder.

prefis -> preference is

@@ +974,5 @@
> +      if (!(flags & (nsMsgFolderFlags::Trash | nsMsgFolderFlags::Junk)))
> +      {
> +        nsCOMPtr<nsIImapIncomingServer> imapServer;
> +        rv = GetImapIncomingServer(getter_AddRefs(imapServer));
> +        NS_ENSURE_SUCCESS(rv, rv);

Do we really want to return early if this fails, or do we just want to give up on setting the flag but continue with the rest of the method?
Attachment #706857 - Flags: review?(irving) → review+
(Assignee)

Comment 3

4 years ago
(In reply to Irving Reid (:irving) from comment #2)
> Do we really want to return early if this fails, or do we just want to give
> up on setting the flag but continue with the rest of the method?

A failure would be pretty strange, especially given that the same thing is used in AddSubfolderWithPath which is called a few lines earlier, and that method is required to succeed to hit the code i'm adding. So I think I prefer the patch as is, with NS_ENSURE_SUCCESS(rv, rv);
(Assignee)

Comment 4

4 years ago
http://hg.mozilla.org/comm-central/rev/e115168a56b6 -> FIXED
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 22.0
You need to log in before you can comment on or make changes to this bug.