Bug 1626739 - Remove obsolete `checkCalendarBinaryComponent` function. r=darktrojan
authorPaul Morris <paul@thunderbird.net>
Sat, 11 Apr 2020 13:51:06 +0300
changeset 29235 9320f207dba3ae3c5a8d9c5429ad32bc2d4fa32c
parent 29234 0f0c5a1c67f07885d4a38fc3d74c19ef6fc4d28f
child 29236 9ee88b4972cc4f30710e21bb2be4ad3fc7c0faeb
push id17271
push usermkmelin@iki.fi
push dateSat, 11 Apr 2020 10:58:29 +0000
treeherdercomm-central@26b9bb2ef883 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdarktrojan
bugs1626739
Bug 1626739 - Remove obsolete `checkCalendarBinaryComponent` function. r=darktrojan And related strings.
calendar/base/content/calendar-chrome-startup.js
calendar/locales/en-US/chrome/lightning/lightning.properties
--- a/calendar/base/content/calendar-chrome-startup.js
+++ b/calendar/base/content/calendar-chrome-startup.js
@@ -28,19 +28,16 @@ var { calendarDeactivator } = ChromeUtil
 
 /**
  * Does calendar initialization steps for a given chrome window. Called at
  * startup as the application window is loaded, before tabs are restored.
  */
 async function loadCalendarComponent() {
   await uninstallLightningAddon();
 
-  // Check if the binary component was loaded.
-  checkCalendarBinaryComponent();
-
   document
     .getElementById("calendarDisplayDeck")
     .addEventListener("select", calObserveDisplayDeckChange, true);
 
   // load locale specific default values for preferences
   setLocaleDefaultPreferences();
 
   // Move around toolbarbuttons and whatever is needed in the UI.
@@ -166,68 +163,16 @@ async function uninstallLightningAddon()
       await addon.uninstall();
     }
   } catch (err) {
     console.error("Error while attempting to uninstall Lightning addon:", err);
   }
 }
 
 /**
- * Checks if the calendar binary component was successfully loaded.
- */
-function checkCalendarBinaryComponent() {
-  // Don't even get started if we are running ical.js or the binary component
-  // was successfully loaded.
-  if (
-    "@mozilla.org/calendar/datetime;1" in Cc ||
-    Services.prefs.getBoolPref("calendar.icaljs", false)
-  ) {
-    return;
-  }
-
-  const THUNDERBIRD_GUID = "{3550f703-e582-4d05-9a08-453d09bdfdc6}";
-  const SEAMONKEY_GUID = "{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}";
-  const LIGHTNING_GUID = "{e2fda1a4-762b-4020-b5ad-a41df1933103}";
-
-  AddonManager.getAddonByID(LIGHTNING_GUID, ext => {
-    if (!ext) {
-      return;
-    }
-
-    let version;
-    let appversion = Services.appinfo.version;
-    let versionparts = appversion.split(".");
-    let extbrand = cal.l10n.getLtnString("brandShortName");
-
-    switch (Services.appinfo.ID) {
-      case THUNDERBIRD_GUID: // e.g. 31.4.0 -> 3.3
-        version = ((parseInt(versionparts[0], 10) + 2) / 10).toFixed(1);
-        break;
-      case SEAMONKEY_GUID: // e.g. 2.28.4 -> 3.3
-        version = ((parseInt(versionparts[1], 10) + 5) / 10).toFixed(1);
-        break;
-    }
-
-    let text;
-    if (version && version != ext.version) {
-      let args = [extbrand, ext.version, version];
-      text = cal.l10n.getLtnString("binaryComponentKnown", args);
-    } else {
-      let brand = cal.l10n.getAnyString("branding", "brand", "brandShortName");
-      let args = [extbrand, brand, appversion, ext.version];
-      text = cal.l10n.getLtnString("binaryComponentUnknown", args);
-    }
-
-    let title = cal.l10n.getLtnString("binaryComponentTitle", [extbrand]);
-    openAddonsMgr("addons://detail/" + encodeURIComponent(LIGHTNING_GUID));
-    Services.prompt.alert(window, title, text);
-  });
-}
-
-/**
  * This function has the sole responsibility to switch back to
  * mail mode (by calling calSwitchToMode("mail")) if we are getting
  * notifications from other panels (besides the calendar views)
  * but find out that we're not in mail mode. This situation can
  * for example happen if we're in calendar mode but the 'new mail'
  * slider gets clicked and wants to display the appropriate mail.
  * All necessary logic for switching between the different modes
  * should live inside of the corresponding functions like:
--- a/calendar/locales/en-US/chrome/lightning/lightning.properties
+++ b/calendar/locales/en-US/chrome/lightning/lightning.properties
@@ -164,37 +164,10 @@ itipCounterBody=%1$S has made a counterp
 itipDeclineCounterBody=%1$S has declined your counterproposal for "%2$S".
 itipDeclineCounterSubject=Counterproposal Declined: %1$S
 
 confirmProcessInvitation=You have recently deleted this item, are you sure you want to process this invitation?
 confirmProcessInvitationTitle=Process Invitation?
 
 invitationsLink.label=Invitations: %1$S
 
-# LOCALIZATION_NOTE(binaryComponentKnown): This is shown when Lightning is
-# missing the binary component and knows how to calculate the expected version
-# number. To test, remove the binary component from the components/
-# subdirectory and start Lightning, or force install into a different
-# Thunderbird version. In the last part of the sentence it should be made clear
-# that the user can install e.g. 3.7, 3.7.1 or anything other 3.7.x version
-# %1$S - The Lightning brand name, from the brandShortName string above.
-# %2$S - The current Lightning version
-# %3$S - The expected Lightning version
-binaryComponentKnown=The binary component required for %1$S could not be loaded, likely because the wrong version combination is being used. You currently have %1$S %2$S installed, but should be using a version from the %3$S series.
-
-# LOCALIZATION_NOTE(binaryComponentUnknown): This is shown when Lightning is
-# missing the binary component but can't calculate the expected version. This
-# happens in the rare case that Lightning is installed into something other
-# than Thunderbird or Seamonkey. You may link to a different page if you can
-# commit to keeping it up to date, I'd recommend staying with the English page.
-# %1$S - The Lightning brand name, from the brandShortName string above.
-# %2$S - The application brand name, e.g. Postbox
-# %3$S - The application version
-# %3$S - The current Lightning version
-binaryComponentUnknown=The binary component required for %1$S could not be loaded, likely because the wrong version combination is being used. You are using %2$S %3$S together with %1$S %4$S. Please check https://developer.mozilla.org/en/Calendar/Calendar_Versions for details.
-
-# LOCALIZATION_NOTE(binaryComponentTitle): The title for the dialog that
-# notifies about a version mismatch.
-# %1$S - The Lightning brand name, from the brandShortName string above.
-binaryComponentTitle=Mismatching %1$S Version
-
 # LOCALIZATION NOTE(noIdentitySelectedNotification):
 noIdentitySelectedNotification=If you want to use this calendar to store invitations to or from other people you should assign an email identity below.