imap saved searches with spaces in the name display escaped name

RESOLVED FIXED in mozilla1.9.1a1


MailNews Core
10 years ago
10 years ago


(Reporter: Bienvenu, Assigned: Bienvenu)



Firefox Tracking Flags

(Not tracked)



(1 attachment)

3.00 KB, patch
: review+
: superreview+
Details | Diff | Splinter Review


10 years ago
Created attachment 329738 [details] [diff] [review]
proposed fix 

If I create an imap saved search called "saved search", we end up creating folders on disk for "saved%20search" and often display that in the UI.

The basic issue is that nsImapURI2Path doesn't handle escaped paths well - it doesn't deal with unescaping them at all. Luckily, nsImapURI2Path isn't used that often, which is why this isn't a problem in general. Usually, IMAP will explicitly call SetFilePath, so that GetFilePath never has to parse the imap uri to figure out the path.

I made nsImapURI2Path look a lot more like nsLocalURI2Path. IMAP Saved searches now handle spaces in the name much better...

An alternative is to make nsImapMailFolder::AddSubfolder call SetPath explicitly on the folder it creates, like nsImapMailFolder::AddSubfolderWithPath does, but that would be just as much work, and nsImapURI2Path should work.
Attachment #329738 - Flags: superreview?(neil)
Attachment #329738 - Flags: review?(neil)

Comment 1

10 years ago
Comment on attachment 329738 [details] [diff] [review]
proposed fix 

>@@ -84,71 +84,64 @@ nsImapURI2Path(const char* rootURI, cons
Is it worth trying to merge this with nsLocalURI2Path in nsMsgUtils.cpp?
Attachment #329738 - Flags: superreview?(neil)
Attachment #329738 - Flags: superreview+
Attachment #329738 - Flags: review?(neil)
Attachment #329738 - Flags: review+


10 years ago
Duplicate of this bug: 427090


10 years ago
OS: Windows XP → All
Hardware: PC → All

Comment 3

10 years ago
(In reply to comment #1)
> (From update of attachment 329738 [details] [diff] [review])
> >@@ -84,71 +84,64 @@ nsImapURI2Path(const char* rootURI, cons
> Is it worth trying to merge this with nsLocalURI2Path in nsMsgUtils.cpp?
It would be nice, but it looked to me like they wanted different results - one wanted an nsILocalFile, and one wanted a string representation of the path for a uri, so it wasn't trivially obvious how they could be combined, other than to perhaps share code.

Comment 4

10 years ago
fixed (for new saved searches going forward)
Last Resolved: 10 years ago
Resolution: --- → FIXED


10 years ago
Target Milestone: --- → mozilla1.9.1a1
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.