bug 487072: make links to the gallery work on Thunderbird
authorMark Banner <bugzilla@standard8.plus.com>
Tue, 10 Nov 2009 16:04:44 -0800
changeset 1215 46683215bda773c5a8d0ea87d3111ff3776a17e9
parent 1214 68dd3b327e9ff24c5175f157b441651e39d403e9
child 1222 f240e130ff36c24d7ef246148579c8c67edcf950
push id777
push usermyk@mozilla.com
push dateWed, 11 Nov 2009 00:04:55 +0000
bugs487072
bug 487072: make links to the gallery work on Thunderbird
client/client.mk
client/content/personas.js
--- a/client/client.mk
+++ b/client/client.mk
@@ -57,10 +57,10 @@ site_path_local   := dist
 site_path_remote  := people.mozilla.com:/home/cbeard/public_html/personas/dist
 
 # The minimum and maximum versions of Firefox and Thunderbird with which
 # the extension is compatible.  These are used in both the install and update
 # manifests.
 fx_min_version    := 3.0
 fx_max_version    := 3.6.*
 
-tb_min_version    := 3.0b1
+tb_min_version    := 3.0b4
 tb_max_version    := 3.0.*
--- a/client/content/personas.js
+++ b/client/content/personas.js
@@ -128,16 +128,21 @@ let PersonaController = {
         return this._footer = document.getElementById("status-bar");
       case PersonaService.FIREFOX_ID:
         return this._footer = document.getElementById("browser-bottombox");
       default:
         throw "unknown application ID " + PersonaService.appInfo.ID;
     }
   },
 
+  get _thunderbirdRegExp() {
+    delete this._thunderbirdRegExp;
+    return this._thunderbirdRegExp = new RegExp("^" + this._siteURL);
+  },
+
   get _siteURL() {
     return "http://" + this._prefs.get("host") + "/";
   },
 
   get _previewTimeout() {
     return this._prefs.get("previewTimeout");
   },
 
@@ -181,17 +186,18 @@ let PersonaController = {
       case PersonaService.THUNDERBIRD_ID:
         // Thunderbird's "openTab" implementation for the "contentTab" mode
         // automatically switches to an existing tab containing the URL we are
         // opening, so we don't have to check for one here.
         Cc['@mozilla.org/appshell/window-mediator;1'].
         getService(Ci.nsIWindowMediator).
         getMostRecentWindow("mail:3pane").
         document.getElementById("tabmail").
-        openTab("contentTab", { contentPage: url });
+        openTab("contentTab", { contentPage: url,
+                                clickHandler: "specialTabs.siteClickHandler(event, PersonaController._thunderbirdRegExp);" });
         break;
 
       case PersonaService.FIREFOX_ID:
       default: {
         // Firefox's "openUILinkIn" implementation doesn't check if there is
         // already an existing tab containing the URL we are opening, so we have
         // to check for one here.
         let found = false;