[tor-commits] [tor-messenger-build/updater] Remove special case normalization from twitter prpl
sukhbir at torproject.org
sukhbir at torproject.org
Mon Aug 29 17:55:16 UTC 2016
commit 877c03082dadf7e503da5acedb2c88f5e7899eff
Author: Arlo Breault <arlolra at gmail.com>
Date: Mon Aug 29 08:54:49 2016 -0700
Remove special case normalization from twitter prpl
---
projects/instantbird/config | 1 +
projects/instantbird/normalize.patch | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+)
diff --git a/projects/instantbird/config b/projects/instantbird/config
index bef6465..81a56d5 100644
--- a/projects/instantbird/config
+++ b/projects/instantbird/config
@@ -79,6 +79,7 @@ input_files:
- filename: xmppRegister.xul
- filename: xmpp-gtalk-resource.patch
- filename: bug-1298574.patch
+ - filename: normalize.patch
- filename: trac-16489.patch
- filename: trac-17896.patch
- filename: trac-17494.patch
diff --git a/projects/instantbird/normalize.patch b/projects/instantbird/normalize.patch
new file mode 100644
index 0000000..3ee2ab5
--- /dev/null
+++ b/projects/instantbird/normalize.patch
@@ -0,0 +1,36 @@
+# HG changeset patch
+# User Arlo Breault <arlolra at gmail.com>
+# Date 1472485829 25200
+# Mon Aug 29 08:50:29 2016 -0700
+# Branch THUNDERBIRD4530_2016082513_RELBRANCH
+# Node ID a13735e63c2e5c6209fefc091263454079a5e517
+# Parent 69baf6e1ea1e4c8f4ddf719bff6b542869a99a23
+Remove backwards compat. normalize in twitter prpl
+
+ * Just use .toLowerCase()
+
+diff --git a/chat/protocols/twitter/twitter.js b/chat/protocols/twitter/twitter.js
+--- a/chat/protocols/twitter/twitter.js
++++ b/chat/protocols/twitter/twitter.js
+@@ -384,21 +384,16 @@ function Account(aProtocol, aImAccount)
+ this._init(aProtocol, aImAccount);
+ this._knownMessageIds = new Set();
+ this._userInfo = new Map();
+ this._friends = new Set();
+ }
+ Account.prototype = {
+ __proto__: GenericAccountPrototype,
+
+- // The correct normalization for twitter would be just toLowerCase().
+- // Unfortunately, for backwards compatibility we retain this normalization,
+- // which can cause edge cases for usernames with underscores.
+- normalize: aString => aString.replace(/[^a-z0-9]/gi, "").toLowerCase(),
+-
+ consumerKey: Services.prefs.getCharPref("chat.twitter.consumerKey"),
+ consumerSecret: Services.prefs.getCharPref("chat.twitter.consumerSecret"),
+ completionURI: "http://oauthcallback.local/",
+ baseURI: "https://api.twitter.com/",
+ _lastMsgId: "",
+
+ // Use this to keep track of the pending timeline requests. We attempt to fetch
+ // home_timeline, @ mentions and tracked keywords (i.e. 3 timelines)
More information about the tor-commits
mailing list