imap saved searches with spaces in the name display escaped name

RESOLVED FIXED in mozilla1.9.1a1

Status

MailNews Core
Search
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: Bienvenu, Assigned: Bienvenu)

Tracking

Trunk
mozilla1.9.1a1

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

3.00 KB, patch
neil@parkwaycc.co.uk
: review+
neil@parkwaycc.co.uk
: superreview+
Details | Diff | Splinter Review
(Assignee)

Description

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+

Updated

10 years ago
Duplicate of this bug: 427090

Updated

10 years ago
OS: Windows XP → All
Hardware: PC → All
(Assignee)

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.
(Assignee)

Comment 4

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

Updated

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.