Bug 483629 - Add BCC to AllAddresses term in local search; r=bugzilla@standard8.plus.com sr=bienvenu
authorKent James <kent@caspia.com>
Sun, 22 Mar 2009 15:33:39 +0100
changeset 2258 06a2b33231051938af962f623c31401f8037ece7
parent 2257 9b8d068b160bf8321af8c2d2bdf43a8b933a3ce7
child 2259 b2c18a94c6283b3606e89506decbbec406d9e54c
push idunknown
push userunknown
push dateunknown
reviewersbugzilla, bienvenu
bugs483629
Bug 483629 - Add BCC to AllAddresses term in local search; r=bugzilla@standard8.plus.com sr=bienvenu
mail/locales/en-US/chrome/messenger/search-attributes.properties
mailnews/base/search/src/nsMsgLocalSearch.cpp
mailnews/base/test/unit/test_searchAddressInAb.js
mailnews/test/data/bugmail7
suite/locales/en-US/chrome/mailnews/search-attributes.properties
--- a/mail/locales/en-US/chrome/messenger/search-attributes.properties
+++ b/mail/locales/en-US/chrome/messenger/search-attributes.properties
@@ -42,16 +42,16 @@ 34=reserved for AB
 35=reserved for AB
 36=reserved for AB
 37=reserved for AB
 38=reserved for AB
 39=reserved for AB
 40=reserved for AB
 41=reserved for AB
 42=reserved for AB
-43=From, To or CC
+43=From, To, CC or BCC
 44=Junk Score Origin
 45=Junk Percent
 46=Attachment Status
 47=Junk Status 
 48=Label
 49=Customize…
 # don't use above 49
--- a/mailnews/base/search/src/nsMsgLocalSearch.cpp
+++ b/mailnews/base/search/src/nsMsgLocalSearch.cpp
@@ -494,26 +494,32 @@ nsresult nsMsgSearchOfflineMail::Process
         }
         break;
       }
       case nsMsgSearchAttrib::AllAddresses:
       {
         PRBool boolKeepGoing;
         aTerm->GetMatchAllBeforeDeciding(&boolKeepGoing);
         msgToMatch->GetRecipients(getter_Copies(recipients));
-        err = aTerm->MatchRfc822String (recipients.get(), charset, charsetOverride, &result);
+        err = aTerm->MatchRfc822String(recipients.get(), charset, charsetOverride, &result);
         if (boolKeepGoing == result)
         {
           msgToMatch->GetCcList(getter_Copies(ccList));
-          err = aTerm->MatchRfc822String (ccList.get(), charset, charsetOverride, &result);
+          err = aTerm->MatchRfc822String(ccList.get(), charset, charsetOverride, &result);
         }
         if (boolKeepGoing == result)
         {
           msgToMatch->GetAuthor(getter_Copies(matchString));
-          err = aTerm->MatchRfc822String (matchString.get(), charset, charsetOverride, &result);
+          err = aTerm->MatchRfc822String(matchString.get(), charset, charsetOverride, &result);
+        }
+        if (boolKeepGoing == result)
+        {
+          nsCString bccList;
+          msgToMatch->GetBccList(getter_Copies(bccList));
+          err = aTerm->MatchRfc822String(bccList.get(), charset, charsetOverride, &result);
         }
         break;
       }
       case nsMsgSearchAttrib::Body:
        {
          nsMsgKey messageOffset;
          PRUint32 lineCount;
          msgToMatch->GetMessageOffset(&messageOffset);
--- a/mailnews/base/test/unit/test_searchAddressInAb.js
+++ b/mailnews/base/test/unit/test_searchAddressInAb.js
@@ -68,27 +68,28 @@ const ToOrCC = nsMsgSearchAttrib.ToOrCC;
 const AllAddresses = nsMsgSearchAttrib.AllAddresses;
 const Keywords = nsMsgSearchAttrib.Keywords; // control entry that is not enabled
 
 /*
  * The address available in the test address book is "PrimaryEmail1@test.invalid"
  * Test emails may also include the address "invalid@example.com"
  *
  *
- * Map of test email contents: (P is "Prim...", I is "inva.." address)
+ * Map of test email contents: (P is "Prim...", I is "inva.." address, N is none)
+ *
  *
- *  Email      From       To      CC
- *    1         P         I       I
- *    2         P         P       P
- *    3         I         P       I
- *    4         I         I       P
- *    5         P         I       P
- *    6         I         I,P     P,I
- *    7         I         I       I
- *    8         I         P       P
+ *  Email      From       To      CC    BCC
+ *    1         P         I       I     N
+ *    2         P         P       P     N
+ *    3         I         P       I     N
+ *    4         I         I       P     N
+ *    5         P         I       P     N
+ *    6         I         I,P     P,I   N
+ *    7         I         I       I     P
+ *    8         I         P       P     N
  *
  */
  
 var Tests =
 [
   { value: ABUri,
     attrib: Sender,
     op: IsInAB,
@@ -99,17 +100,17 @@ var Tests =
     count: 4 },
   { value: ABUri,
     attrib: ToOrCC,
     op: IsInAB,
     count: 6 },
   { value: ABUri,
     attrib: AllAddresses,
     op: IsInAB,
-    count: 7 },
+    count: 8 },
   { value: ABUri,
     attrib: CCopy,
     op: IsInAB,
     count: 5 },
   { value: ABUri,
     attrib: Sender,
     op: IsntInAB,
     count: 5 },
--- a/mailnews/test/data/bugmail7
+++ b/mailnews/test/data/bugmail7
@@ -25,16 +25,17 @@ Received: from mrapp51.mozilla.org (mrap
 Received: (from root@localhost)
 	by mrapp51.mozilla.org (8.13.8/8.13.8/Submit) id m47LtAEf007542;
 	Wed, 7 May 2008 14:55:10 -0700
 Date: Wed, 7 May 2008 14:55:10 -0700
 Message-Id: <bugmail7.m47LtAEf007542@mrapp51.mozilla.org>
 From: invalid@example.com
 To: invalid@example.com
 Cc: invalid@example.com
+Bcc: PrimaryEmail1@test.invalid
 Subject: [Bug 397009] A filter will let me tag, but not untag
 X-Bugzilla-Reason: None
 X-Bugzilla-Type: newchanged
 X-Bugzilla-Watch-Reason: QAcontact filters@mail.bugs
 X-Bugzilla-Product: Core
 X-Bugzilla-Component: MailNews: Filters
 X-Bugzilla-Keywords: 
 X-Bugzilla-Severity: enhancement
--- a/suite/locales/en-US/chrome/mailnews/search-attributes.properties
+++ b/suite/locales/en-US/chrome/mailnews/search-attributes.properties
@@ -42,16 +42,16 @@ 34=reserved for AB
 35=reserved for AB
 36=reserved for AB
 37=reserved for AB
 38=reserved for AB
 39=reserved for AB
 40=reserved for AB
 41=reserved for AB
 42=reserved for AB
-43=From, To or CC
+43=From, To, CC or BCC
 44=Junk Score Origin
 45=Junk Percent
 46=Attachment Status
 47=Junk Status 
 48=Label
 # don't use above 49
 49=Customize…