From e529f968ac8f06f63a950d48d3e9bbe0688d64b2 Mon Sep 17 00:00:00 2001 From: Myk Melez Date: Thu, 14 May 2009 18:01:14 -0700 Subject: [PATCH] use the MACHINE_URI constant in the Twitter source instead of hardcoding the URL in each request --HG-- extra : rebase_source : 9093ede2c634de0118af69af9d590cafd83172cc --- modules/twitter.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/twitter.js b/modules/twitter.js index 27c329f..da1128d 100644 --- a/modules/twitter.js +++ b/modules/twitter.js @@ -282,7 +282,8 @@ SnowlTwitter.prototype = { request.addEventListener("error", function(e) { t.onSubscribeError(e) }, false); request.QueryInterface(Ci.nsIXMLHttpRequest); - request.open("GET", "https://" + this.username + "@twitter.com/statuses/friends_timeline.json?count=200", true); + request.open("GET", MACHINE_URI.replace("^https://", "https://" + this.username + "@") + + "/statuses/friends_timeline.json?count=200", true); request.setRequestHeader("Authorization", "Basic " + btoa(credentials.username + ":" + credentials.password)); @@ -438,7 +439,8 @@ SnowlTwitter.prototype = { params.push("since_id=" + maxID); } - let url = "https://" + this.username + "@twitter.com/statuses/friends_timeline.json?" + params.join("&"); + let url = MACHINE_URI.replace("^https://", "https://" + this.username + "@") + + "/statuses/friends_timeline.json?" + params.join("&"); this._log.debug("refresh: this.name = " + this.name + "; url = " + url); request.open("GET", url, true); @@ -675,7 +677,7 @@ SnowlTwitter.prototype = { } request.QueryInterface(Ci.nsIXMLHttpRequest); - request.open("POST", "https://" + this.username + "@twitter.com/statuses/update.json", true); + request.open("POST", MACHINE_URI.replace("^https://", "https://" + this.username + "@") + "/statuses/update.json", true); // If the login manager has saved credentials for this account, provide them // to the server. Otherwise, no worries, Necko will automatically call our // notification callback, which will prompt the user to enter their credentials.