Bug 1503395 - Bug 1482720 follow-up: Don't skip ParseUrl() completely, call at least ParseSearchPart(). r=aceman a=jorgk
authorJorg K <jorgk@jorgk.com>
Thu, 01 Nov 2018 21:50:13 +0100
changeset 32619 43fe4f66a81fa15e30b9cde107bc63fa029afe52
parent 32618 3a98ae26df27398c1f868eb016daebd384aeecb2
child 32620 6ee1e1ef041d15c166330eb8cbe71115dde72100
push id2331
push usermozilla@jorgk.com
push dateSat, 03 Nov 2018 10:01:38 +0000
treeherdercomm-beta@3e08c32a7ddb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman, jorgk
bugs1503395, 1482720
Bug 1503395 - Bug 1482720 follow-up: Don't skip ParseUrl() completely, call at least ParseSearchPart(). r=aceman a=jorgk
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();