Bug 1381969 - Don't read non-existent mail.enable_automatic_image_resizing in TB. r=jorgk
authoraceman <acelists@atlas.sk>
Mon, 24 Jul 2017 14:07:00 +0200
changeset 28508 942c522bd77ecffa2c9aa085d185b7b0ece0e645
parent 28507 8bbe89ca7478fb2ce0a8afc5c65a39fe77a5f51d
child 28509 8f404af70ca26af39dd3f1472d8fd357508a1ce6
push id1986
push userclokep@gmail.com
push dateWed, 02 Aug 2017 14:43:31 +0000
treeherdercomm-beta@b51c9adf2c9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk
bugs1381969
Bug 1381969 - Don't read non-existent mail.enable_automatic_image_resizing in TB. r=jorgk
mailnews/mime/src/mimemoz2.cpp
--- a/mailnews/mime/src/mimemoz2.cpp
+++ b/mailnews/mime/src/mimemoz2.cpp
@@ -1084,40 +1084,44 @@ mime_image_end(void *image_closure, int 
 
 
 static char *
 mime_image_make_image_html(void *image_closure)
 {
   mime_image_stream_data *mid =
     (mime_image_stream_data *) image_closure;
 
-  const char *prefix;
-  /* Wouldn't it be nice if attributes were case-sensitive? */
-  const char *scaledPrefix = "<DIV CLASS=\"moz-attached-image-container\"><IMG CLASS=\"moz-attached-image\" shrinktofit=\"yes\" SRC=\"";
-  const char *unscaledPrefix = "<DIV CLASS=\"moz-attached-image-container\"><IMG CLASS=\"moz-attached-image\" SRC=\"";
-  const char *suffix = "\"></DIV>";
-  const char *url;
-  char *buf;
-
   PR_ASSERT(mid);
   if (!mid) return 0;
 
   /* Internal-external-reconnect only works when going to the screen. */
   if (!mid->istream)
     return strdup("<DIV CLASS=\"moz-attached-image-container\"><IMG SRC=\"resource://gre-resources/loading-image.png\" ALT=\"[Image]\"></DIV>");
 
+  const char *prefix;
+  const char *url;
+  char *buf;
+  /* Wouldn't it be nice if attributes were case-sensitive? */
+  const char *scaledPrefix = "<DIV CLASS=\"moz-attached-image-container\"><IMG CLASS=\"moz-attached-image\" shrinktofit=\"yes\" SRC=\"";
+  const char *suffix = "\"></DIV>";
+  // Thunderbird doesn't have this pref.
+#ifdef MOZ_SUITE
+  const char *unscaledPrefix = "<DIV CLASS=\"moz-attached-image-container\"><IMG CLASS=\"moz-attached-image\" SRC=\"";
   nsCOMPtr<nsIPrefBranch> prefBranch;
   nsCOMPtr<nsIPrefService> prefSvc(do_GetService(NS_PREFSERVICE_CONTRACTID));
   bool resize = true;
 
   if (prefSvc)
     prefSvc->GetBranch("", getter_AddRefs(prefBranch));
   if (prefBranch)
     prefBranch->GetBoolPref("mail.enable_automatic_image_resizing", &resize); // ignore return value
   prefix = resize ? scaledPrefix : unscaledPrefix;
+#else
+  prefix = scaledPrefix;
+#endif
 
   if ( (!mid->url) || (!(*mid->url)) )
     url = "";
   else
     url = mid->url;
 
   uint32_t buflen = strlen(prefix) + strlen(suffix) + strlen(url) + 20;
   buf = (char *) PR_MALLOC (buflen);