Bug 1584473 - Fix doubled up sub-expressions in MIME and MAPI. r=aceman
authorJorg K <jorgk@jorgk.com>
Sat, 28 Sep 2019 21:45:25 +0200
changeset 37008 629098a84b46e290ab42efad51d5204fd5784335
parent 37007 57f0f8a7f2426b4be35fd5af8f8471c3dc8c26a4
child 37009 4f8dc02144b194e37b780dbdbb5b54669d11fde9
push id395
push userclokep@gmail.com
push dateMon, 02 Dec 2019 19:38:57 +0000
reviewersaceman
bugs1584473
Bug 1584473 - Fix doubled up sub-expressions in MIME and MAPI. r=aceman
mailnews/import/outlook/src/MapiApi.cpp
mailnews/mime/emitters/nsEmitterUtils.cpp
mailnews/mime/src/mimemsig.cpp
--- a/mailnews/import/outlook/src/MapiApi.cpp
+++ b/mailnews/import/outlook/src/MapiApi.cpp
@@ -1304,18 +1304,16 @@ void CMapiApi::ReportLongProp(const char
 
     num.AppendInt((int32_t)pVal->Value.l);
     num2.AppendInt((int32_t)pVal->Value.l, 16);
     MAPI_TRACE3("%s %s, 0x%s\n", pTag, num, num2);
   } else if (pVal && (PROP_TYPE(pVal->ulPropTag) == PT_NULL)) {
     MAPI_TRACE1("%s {NULL}\n", pTag);
   } else if (pVal && (PROP_TYPE(pVal->ulPropTag) == PT_ERROR)) {
     MAPI_TRACE1("%s {Error retrieving property}\n", pTag);
-  } else if (pVal && (PROP_TYPE(pVal->ulPropTag) == PT_ERROR)) {
-    MAPI_TRACE1("%s {Error retrieving property}\n", pTag);
   } else {
     MAPI_TRACE1("%s invalid value, expecting long\n", pTag);
   }
   if (pVal) MAPIFreeBuffer(pVal);
 }
 
 void CMapiApi::ReportStringProp(const char *pTag, LPSPropValue pVal) {
   if (pVal && (PROP_TYPE(pVal->ulPropTag) == PT_TSTRING)) {
--- a/mailnews/mime/emitters/nsEmitterUtils.cpp
+++ b/mailnews/mime/emitters/nsEmitterUtils.cpp
@@ -20,29 +20,26 @@ extern "C" bool EmitThisHeaderForPrefSet
     if ((!strcmp(header, HEADER_SUBJECT)) || (!strcmp(header, HEADER_FROM)) ||
         (!strcmp(header, HEADER_DATE)))
       return true;
     else
       return false;
   }
 
   if (nsMimeHeaderDisplayTypes::NormalHeaders == dispType) {
-    if ((!strcmp(header, HEADER_DATE)) || (!strcmp(header, HEADER_TO)) ||
-        (!strcmp(header, HEADER_SUBJECT)) || (!strcmp(header, HEADER_SENDER)) ||
-        (!strcmp(header, HEADER_RESENT_TO)) ||
-        (!strcmp(header, HEADER_RESENT_SENDER)) ||
-        (!strcmp(header, HEADER_RESENT_FROM)) ||
-        (!strcmp(header, HEADER_RESENT_CC)) ||
-        (!strcmp(header, HEADER_REPLY_TO)) ||
-        (!strcmp(header, HEADER_REFERENCES)) ||
-        (!strcmp(header, HEADER_NEWSGROUPS)) ||
-        (!strcmp(header, HEADER_MESSAGE_ID)) ||
-        (!strcmp(header, HEADER_FROM)) ||
-        (!strcmp(header, HEADER_FOLLOWUP_TO)) || (!strcmp(header, HEADER_CC)) ||
-        (!strcmp(header, HEADER_ORGANIZATION)) ||
-        (!strcmp(header, HEADER_REPLY_TO)) || (!strcmp(header, HEADER_BCC)))
+    if (!strcmp(header, HEADER_DATE) || !strcmp(header, HEADER_TO) ||
+        !strcmp(header, HEADER_SUBJECT) || !strcmp(header, HEADER_SENDER) ||
+        !strcmp(header, HEADER_RESENT_TO) ||
+        !strcmp(header, HEADER_RESENT_SENDER) ||
+        !strcmp(header, HEADER_RESENT_FROM) ||
+        !strcmp(header, HEADER_RESENT_CC) || !strcmp(header, HEADER_REPLY_TO) ||
+        !strcmp(header, HEADER_REFERENCES) ||
+        !strcmp(header, HEADER_NEWSGROUPS) ||
+        !strcmp(header, HEADER_MESSAGE_ID) || !strcmp(header, HEADER_FROM) ||
+        !strcmp(header, HEADER_FOLLOWUP_TO) || !strcmp(header, HEADER_CC) ||
+        !strcmp(header, HEADER_ORGANIZATION) || !strcmp(header, HEADER_BCC))
       return true;
     else
       return false;
   }
 
   return true;
 }
--- a/mailnews/mime/src/mimemsig.cpp
+++ b/mailnews/mime/src/mimemsig.cpp
@@ -538,17 +538,17 @@ static int MimeMultipartSigned_emit_chil
 
   NS_ASSERTION(sig->crypto_closure, "no crypto closure");
 
   /* Emit some HTML saying whether the signature was cool.
    But don't emit anything if in FO_QUOTE_MESSAGE mode.
    */
   if (obj->options && obj->options->headers != MimeHeadersCitation &&
       obj->options->write_html_p && obj->options->output_fn &&
-      obj->options->headers != MimeHeadersCitation && sig->crypto_closure) {
+      sig->crypto_closure) {
     // Calling crypto_generate_html may trigger wanted side effects,
     // but we're no longer using its results.
     char *html = (((MimeMultipartSignedClass *)obj->clazz)
                       ->crypto_generate_html(sig->crypto_closure));
     PR_FREEIF(html);
 
     /* Now that we have written out the crypto stamp, the outermost header
      block is well and truly closed.  If this is in fact the outermost