Bug 1503395 - Bug 1482720 follow-up: Don't skip ParseUrl() completely, call at least ParseSearchPart(). r=aceman
authorJorg K <jorgk@jorgk.com>
Thu, 01 Nov 2018 21:50:13 +0100
changeset 33641 22fd73b428cd4578b5cfffb1833d62d0742759d8
parent 33640 87943872543e306a510525a2a02502564ff49f18
child 33642 53c3270b2956df2826a253723631edec04f2cd86
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersaceman
bugs1503395, 1482720
Bug 1503395 - Bug 1482720 follow-up: Don't skip ParseUrl() completely, call at least ParseSearchPart(). r=aceman
mailnews/local/src/nsMailboxUrl.cpp
--- a/mailnews/local/src/nsMailboxUrl.cpp
+++ b/mailnews/local/src/nsMailboxUrl.cpp
@@ -411,21 +411,28 @@ nsresult nsMailboxUrl::ParseUrl()
 
   GetPathQueryRef(m_file);
   return NS_OK;
 }
 
 nsresult nsMailboxUrl::SetSpecInternal(const nsACString &aSpec)
 {
   nsresult rv = nsMsgMailNewsUrl::SetSpecInternal(aSpec);
-  // Do not try to parse URLs of the form
-  // mailbox://user@domain@server/folder?number=nn since this will fail.
-  // Check for format lacking absolute path.
-  if (NS_SUCCEEDED(rv) && PromiseFlatCString(aSpec).Find("///") != kNotFound)
-    rv = ParseUrl();
+  if (NS_SUCCEEDED(rv)) {
+    // Do not try to parse URLs of the form
+    // mailbox://user@domain@server/folder?number=nn since this will fail.
+    // Check for format lacking absolute path.
+    if (PromiseFlatCString(aSpec).Find("///") != kNotFound) {
+      rv = ParseUrl();
+    } else {
+      // We still need to parse the search part to populate
+      // m_messageKey etc.
+      ParseSearchPart();
+    }
+  }
   return rv;
 }
 
 nsresult nsMailboxUrl::SetQuery(const nsACString &aQuery)
 {
   nsresult rv = nsMsgMailNewsUrl::SetQuery(aQuery);
   if (NS_SUCCEEDED(rv))
     rv = ParseUrl();