[tor-commits] [tor-messenger-build/master] Rebase patches for the 45.5.1 release

arlo at torproject.org arlo at torproject.org
Wed Nov 30 23:54:40 UTC 2016


commit 4487981cf4757e28ace2593cc653de8fa9b36011
Author: Arlo Breault <arlolra at gmail.com>
Date:   Wed Nov 30 15:54:04 2016 -0800

    Rebase patches for the 45.5.1 release
---
 ChangeLog                                          |    7 +
 .../0001-Set-Tor-Messenger-preferences.patch       |    2 +-
 ...0002-Trac-16489-Prevent-account-autologin.patch |    2 +-
 ...Support-Special-Characters-input-prompt-o.patch |    2 +-
 ...Better-error-reporting-for-failed-outgoin.patch |    2 +-
 .../0005-Trac-13312-OTR-over-Twitter-DMs.patch     | 1111 ++++++++------------
 ...-Fix-tab-strip-background-colour-on-OS-X..patch |    2 +-
 ...-XMPP-createConversation-should-handle-in.patch |    2 +-
 ...-Set-_userVCard-own-property-when-downloa.patch |    2 +-
 .../0009-XMPP-in-band-registration.patch           |    2 +-
 .../instantbird/0010-Remove-search-from-UI.patch   |    2 +-
 .../0011-Add-Tor-Messenger-branding.patch          |    2 +-
 projects/instantbird/0012-Account-picture.patch    |    2 +-
 .../0013-Modify-protocol-defaults.patch            |    2 +-
 .../instantbird/0014-Modify-IRC-defaults.patch     |    2 +-
 projects/instantbird/0015-Modify-themes.patch      |    2 +-
 .../instantbird/0016-Modify-XMPP-defaults.patch    |    2 +-
 projects/instantbird/0017-Remove-logging-UI.patch  |    2 +-
 projects/instantbird/0018-Cert-override.patch      |    2 +-
 .../0019-Display-all-traffic-over-Tor.patch        |    2 +-
 .../instantbird/0020-Trac-17480-Content-sink.patch |   23 +-
 .../0021-SASL-ECDSA-NIST256P-CHALLENGE.patch       |    2 +-
 ...-msg-is-not-defined-error-in-irc.js-chang.patch |    2 +-
 ...Contact-list-entries-should-adapt-their-h.patch |    2 +-
 ...1187281-Only-show-close-button-on-Windows.patch |    2 +-
 ...-Remove-old-Yahoo-Messenger-support.-r-al.patch |    2 +-
 ...0001-Trac-19910-Prevents-STARTTLS-in-XMPP.patch |    2 +-
 .../mozilla/0002-Trac-16475-Block-flash-too.patch  |    2 +-
 ...Avoid-the-need-to-download-the-font-Osaka.patch |    2 +-
 ...Update-OS-X-toolchain-to-work-with-ESR-45.patch |    2 +-
 projects/mozilla/0005-OSX-package-as-tar.bz2.patch |    2 +-
 projects/mozilla/0006-Updater-fixups-for-TM.patch  |    2 +-
 projects/mozilla/config                            |    6 +-
 projects/tor-browser/config                        |    2 +-
 34 files changed, 477 insertions(+), 730 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5de7902..c661505 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Tor Messenger 0.3.0b2 --
+
+ * All Platforms
+   * Use the tor-browser-45.5.1esr-6.0-1-build1 tag on tor-browser
+   * Use the THUNDERBIRD_45_5_1_RELEASE tag on comm-esr45
+   * Update tor-browser to 6.0.7
+
 Tor Messenger 0.3.0b1 -- November 22, 2016
  * All Platforms
    * Use the tor-browser-45.5.0esr-6.0-1 branch (e5dafab8) on tor-browser
diff --git a/projects/instantbird/0001-Set-Tor-Messenger-preferences.patch b/projects/instantbird/0001-Set-Tor-Messenger-preferences.patch
index 605dac6..63f721b 100644
--- a/projects/instantbird/0001-Set-Tor-Messenger-preferences.patch
+++ b/projects/instantbird/0001-Set-Tor-Messenger-preferences.patch
@@ -1,4 +1,4 @@
-From a389b023c2017828d58195917fe70c3babfcb6ae Mon Sep 17 00:00:00 2001
+From e1433d0d96a99a6382b70fffa60158b8b5efeefa Mon Sep 17 00:00:00 2001
 From: Sukhbir Singh <sukhbir at torproject.org>
 Date: Mon, 10 Oct 2016 19:48:41 -0700
 Subject: [PATCH 01/25] Set Tor Messenger preferences
diff --git a/projects/instantbird/0002-Trac-16489-Prevent-account-autologin.patch b/projects/instantbird/0002-Trac-16489-Prevent-account-autologin.patch
index dfafdf3..4d05d86 100644
--- a/projects/instantbird/0002-Trac-16489-Prevent-account-autologin.patch
+++ b/projects/instantbird/0002-Trac-16489-Prevent-account-autologin.patch
@@ -1,4 +1,4 @@
-From 0560300c21e64eef9fe43ce6beee0abb76417603 Mon Sep 17 00:00:00 2001
+From eccb4c61667e2887f335b780dcf3f1545d03cbb3 Mon Sep 17 00:00:00 2001
 From: Arlo Breault <arlolra at gmail.com>
 Date: Mon, 16 Nov 2015 20:37:53 -0800
 Subject: [PATCH 02/25] Trac 16489: Prevent account autologin
diff --git a/projects/instantbird/0003-Trac-17896-Support-Special-Characters-input-prompt-o.patch b/projects/instantbird/0003-Trac-17896-Support-Special-Characters-input-prompt-o.patch
index 65579d9..3b2cf27 100644
--- a/projects/instantbird/0003-Trac-17896-Support-Special-Characters-input-prompt-o.patch
+++ b/projects/instantbird/0003-Trac-17896-Support-Special-Characters-input-prompt-o.patch
@@ -1,4 +1,4 @@
-From 5bcf95f441ca97cbd5bc1f352d014a655ab52cf5 Mon Sep 17 00:00:00 2001
+From d433556773d91789bd05019c64a751a8afcdd763 Mon Sep 17 00:00:00 2001
 From: aleth <aleth at instantbird.org>
 Date: Sat, 30 Jan 2016 20:56:38 +0100
 Subject: [PATCH 03/25] Trac 17896: Support "Special Characters" input prompt
diff --git a/projects/instantbird/0004-Trac-17494-Better-error-reporting-for-failed-outgoin.patch b/projects/instantbird/0004-Trac-17494-Better-error-reporting-for-failed-outgoin.patch
index 5092455..e8d0da9 100644
--- a/projects/instantbird/0004-Trac-17494-Better-error-reporting-for-failed-outgoin.patch
+++ b/projects/instantbird/0004-Trac-17494-Better-error-reporting-for-failed-outgoin.patch
@@ -1,4 +1,4 @@
-From 79b9e3676c7277d0efd3e30822e8663ff8900d67 Mon Sep 17 00:00:00 2001
+From 3d8ced7b6852eb7fbee140825e39345906768729 Mon Sep 17 00:00:00 2001
 From: Arlo Breault <arlolra at gmail.com>
 Date: Tue, 2 Feb 2016 16:04:51 -0800
 Subject: [PATCH 04/25] Trac 17494: Better error reporting for failed outgoing
diff --git a/projects/instantbird/0005-Trac-13312-OTR-over-Twitter-DMs.patch b/projects/instantbird/0005-Trac-13312-OTR-over-Twitter-DMs.patch
index a0b7ab5..bfb301c 100644
--- a/projects/instantbird/0005-Trac-13312-OTR-over-Twitter-DMs.patch
+++ b/projects/instantbird/0005-Trac-13312-OTR-over-Twitter-DMs.patch
@@ -1,28 +1,19 @@
-From 033118def50148c21b599e7db8b14aba988a1f3a Mon Sep 17 00:00:00 2001
+From 5c5afcd859e98522928bd1bfcd70d665c5fb579c Mon Sep 17 00:00:00 2001
 From: Arlo Breault <arlolra at gmail.com>
 Date: Tue, 15 Mar 2016 17:40:42 -0700
 Subject: [PATCH 05/25] Trac 13312: OTR over Twitter DMs
 
 ---
- chat/components/src/imConversations.js  |   4 +-
- chat/modules/jsProtoHelper.jsm          |   1 +
- chat/protocols/twitter/twitter-text.jsm | 267 +++++++++++----------
- chat/protocols/twitter/twitter.js       | 406 ++++++++++++++++----------------
- 4 files changed, 355 insertions(+), 323 deletions(-)
+ chat/components/src/imConversations.js |   3 +-
+ chat/modules/imContentSink.jsm         |  10 +-
+ chat/protocols/twitter/twitter.js      | 484 +++++++++++++++++++--------------
+ 3 files changed, 289 insertions(+), 208 deletions(-)
 
 diff --git a/chat/components/src/imConversations.js b/chat/components/src/imConversations.js
-index 6fc5d0d..5187212 100644
+index 6fc5d0d..2a53a2c 100644
 --- a/chat/components/src/imConversations.js
 +++ b/chat/components/src/imConversations.js
-@@ -30,6 +30,7 @@ function imMessage(aPrplMessage) {
- }
- imMessage.prototype = {
-   __proto__: ClassInfo(["imIMessage", "prplIMessage"], "IM Message"),
-+  get wrappedJSObject() { return this; },
-   cancelled: false,
-   color: "",
-   _displayMessage: null,
-@@ -414,7 +415,8 @@ UIConversation.prototype = {
+@@ -414,7 +414,8 @@ UIConversation.prototype = {
        this.notifyObservers(aSubject, "received-message");
        if (aSubject.cancelled)
          return;
@@ -32,423 +23,50 @@ index 6fc5d0d..5187212 100644
  
        this._messages.push(aSubject);
        ++this._unreadMessageCount;
-diff --git a/chat/modules/jsProtoHelper.jsm b/chat/modules/jsProtoHelper.jsm
-index 42bd9f6..69af716 100644
---- a/chat/modules/jsProtoHelper.jsm
-+++ b/chat/modules/jsProtoHelper.jsm
-@@ -381,6 +381,7 @@ AccountBuddy.prototype = GenericAccountBuddyPrototype;
- 
- var GenericMessagePrototype = {
-   __proto__: ClassInfo("prplIMessage", "generic message object"),
-+  get wrappedJSObject() { return this; },
- 
-   _lastId: 0,
-   _init: function (aWho, aMessage, aObject) {
-diff --git a/chat/protocols/twitter/twitter-text.jsm b/chat/protocols/twitter/twitter-text.jsm
-index 1940fd2..a8f8370 100644
---- a/chat/protocols/twitter/twitter-text.jsm
-+++ b/chat/protocols/twitter/twitter-text.jsm
-@@ -19,7 +19,7 @@ var window = {};
- 
- // The code below is imported from Twitter's JavaScript utility for parsing
- // tweets. The original version of this file can be found at
--// https://github.com/twitter/twitter-text-js/blob/master/twitter-text.js
-+// https://github.com/twitter/twitter-text/blob/master/js/twitter-text.js
- 
- (function() {
-   if (typeof twttr === "undefined" || twttr === null) {
-@@ -125,80 +125,6 @@ var window = {};
-   twttr.txt.regexen.rtl_chars = /[\u0600-\u06FF]|[\u0750-\u077F]|[\u0590-\u05FF]|[\uFE70-\uFEFF]/mg;
-   twttr.txt.regexen.non_bmp_code_pairs = /[\uD800-\uDBFF][\uDC00-\uDFFF]/mg;
- 
--  var nonLatinHashtagChars = [];
--  // Cyrillic
--  addCharsToCharClass(nonLatinHashtagChars, 0x0400, 0x04ff); // Cyrillic
--  addCharsToCharClass(nonLatinHashtagChars, 0x0500, 0x0527); // Cyrillic Supplement
--  addCharsToCharClass(nonLatinHashtagChars, 0x2de0, 0x2dff); // Cyrillic Extended A
--  addCharsToCharClass(nonLatinHashtagChars, 0xa640, 0xa69f); // Cyrillic Extended B
--  // Hebrew
--  addCharsToCharClass(nonLatinHashtagChars, 0x0591, 0x05bf); // Hebrew
--  addCharsToCharClass(nonLatinHashtagChars, 0x05c1, 0x05c2);
--  addCharsToCharClass(nonLatinHashtagChars, 0x05c4, 0x05c5);
--  addCharsToCharClass(nonLatinHashtagChars, 0x05c7, 0x05c7);
--  addCharsToCharClass(nonLatinHashtagChars, 0x05d0, 0x05ea);
--  addCharsToCharClass(nonLatinHashtagChars, 0x05f0, 0x05f4);
--  addCharsToCharClass(nonLatinHashtagChars, 0xfb12, 0xfb28); // Hebrew Presentation Forms
--  addCharsToCharClass(nonLatinHashtagChars, 0xfb2a, 0xfb36);
--  addCharsToCharClass(nonLatinHashtagChars, 0xfb38, 0xfb3c);
--  addCharsToCharClass(nonLatinHashtagChars, 0xfb3e, 0xfb3e);
--  addCharsToCharClass(nonLatinHashtagChars, 0xfb40, 0xfb41);
--  addCharsToCharClass(nonLatinHashtagChars, 0xfb43, 0xfb44);
--  addCharsToCharClass(nonLatinHashtagChars, 0xfb46, 0xfb4f);
--  // Arabic
--  addCharsToCharClass(nonLatinHashtagChars, 0x0610, 0x061a); // Arabic
--  addCharsToCharClass(nonLatinHashtagChars, 0x0620, 0x065f);
--  addCharsToCharClass(nonLatinHashtagChars, 0x066e, 0x06d3);
--  addCharsToCharClass(nonLatinHashtagChars, 0x06d5, 0x06dc);
--  addCharsToCharClass(nonLatinHashtagChars, 0x06de, 0x06e8);
--  addCharsToCharClass(nonLatinHashtagChars, 0x06ea, 0x06ef);
--  addCharsToCharClass(nonLatinHashtagChars, 0x06fa, 0x06fc);
--  addCharsToCharClass(nonLatinHashtagChars, 0x06ff, 0x06ff);
--  addCharsToCharClass(nonLatinHashtagChars, 0x0750, 0x077f); // Arabic Supplement
--  addCharsToCharClass(nonLatinHashtagChars, 0x08a0, 0x08a0); // Arabic Extended A
--  addCharsToCharClass(nonLatinHashtagChars, 0x08a2, 0x08ac);
--  addCharsToCharClass(nonLatinHashtagChars, 0x08e4, 0x08fe);
--  addCharsToCharClass(nonLatinHashtagChars, 0xfb50, 0xfbb1); // Arabic Pres. Forms A
--  addCharsToCharClass(nonLatinHashtagChars, 0xfbd3, 0xfd3d);
--  addCharsToCharClass(nonLatinHashtagChars, 0xfd50, 0xfd8f);
--  addCharsToCharClass(nonLatinHashtagChars, 0xfd92, 0xfdc7);
--  addCharsToCharClass(nonLatinHashtagChars, 0xfdf0, 0xfdfb);
--  addCharsToCharClass(nonLatinHashtagChars, 0xfe70, 0xfe74); // Arabic Pres. Forms B
--  addCharsToCharClass(nonLatinHashtagChars, 0xfe76, 0xfefc);
--  addCharsToCharClass(nonLatinHashtagChars, 0x200c, 0x200c); // Zero-Width Non-Joiner
--  // Thai
--  addCharsToCharClass(nonLatinHashtagChars, 0x0e01, 0x0e3a);
--  addCharsToCharClass(nonLatinHashtagChars, 0x0e40, 0x0e4e);
--  // Hangul (Korean)
--  addCharsToCharClass(nonLatinHashtagChars, 0x1100, 0x11ff); // Hangul Jamo
--  addCharsToCharClass(nonLatinHashtagChars, 0x3130, 0x3185); // Hangul Compatibility Jamo
--  addCharsToCharClass(nonLatinHashtagChars, 0xA960, 0xA97F); // Hangul Jamo Extended-A
--  addCharsToCharClass(nonLatinHashtagChars, 0xAC00, 0xD7AF); // Hangul Syllables
--  addCharsToCharClass(nonLatinHashtagChars, 0xD7B0, 0xD7FF); // Hangul Jamo Extended-B
--  addCharsToCharClass(nonLatinHashtagChars, 0xFFA1, 0xFFDC); // half-width Hangul
--  // Japanese and Chinese
--  addCharsToCharClass(nonLatinHashtagChars, 0x30A1, 0x30FA); // Katakana (full-width)
--  addCharsToCharClass(nonLatinHashtagChars, 0x30FC, 0x30FE); // Katakana Chouon and iteration marks (full-width)
--  addCharsToCharClass(nonLatinHashtagChars, 0xFF66, 0xFF9F); // Katakana (half-width)
--  addCharsToCharClass(nonLatinHashtagChars, 0xFF70, 0xFF70); // Katakana Chouon (half-width)
--  addCharsToCharClass(nonLatinHashtagChars, 0xFF10, 0xFF19); // \
--  addCharsToCharClass(nonLatinHashtagChars, 0xFF21, 0xFF3A); //  - Latin (full-width)
--  addCharsToCharClass(nonLatinHashtagChars, 0xFF41, 0xFF5A); // /
--  addCharsToCharClass(nonLatinHashtagChars, 0x3041, 0x3096); // Hiragana
--  addCharsToCharClass(nonLatinHashtagChars, 0x3099, 0x309E); // Hiragana voicing and iteration mark
--  addCharsToCharClass(nonLatinHashtagChars, 0x3400, 0x4DBF); // Kanji (CJK Extension A)
--  addCharsToCharClass(nonLatinHashtagChars, 0x4E00, 0x9FFF); // Kanji (Unified)
--  // -- Disabled as it breaks the Regex.
--  //addCharsToCharClass(nonLatinHashtagChars, 0x20000, 0x2A6DF); // Kanji (CJK Extension B)
--  addCharsToCharClass(nonLatinHashtagChars, 0x2A700, 0x2B73F); // Kanji (CJK Extension C)
--  addCharsToCharClass(nonLatinHashtagChars, 0x2B740, 0x2B81F); // Kanji (CJK Extension D)
--  addCharsToCharClass(nonLatinHashtagChars, 0x2F800, 0x2FA1F); // Kanji (CJK supplement)
--  addCharsToCharClass(nonLatinHashtagChars, 0x3003, 0x3003); // Kanji iteration mark
--  addCharsToCharClass(nonLatinHashtagChars, 0x3005, 0x3005); // Kanji iteration mark
--  addCharsToCharClass(nonLatinHashtagChars, 0x303B, 0x303B); // Han iteration mark
--
--  twttr.txt.regexen.nonLatinHashtagChars = regexSupplant(nonLatinHashtagChars.join(""));
--
-   var latinAccentChars = [];
-   // Latin accented characters (subtracted 0xD7 from the range, it's a confusable multiplication sign. Looks like "x")
-   addCharsToCharClass(latinAccentChars, 0x00c0, 0x00d6);
-@@ -225,16 +151,20 @@ var window = {};
-   addCharsToCharClass(latinAccentChars, 0x1e00, 0x1eff);
-   twttr.txt.regexen.latinAccentChars = regexSupplant(latinAccentChars.join(""));
- 
--  // A hashtag must contain characters, numbers and underscores, but not all numbers.
-+  var unicodeLettersAndMarks = "A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0
 B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8
 -\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u
 2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\u
 FB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44
 \u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099
 \u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D";
-+  var unicodeNumbers = "0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19";
-+  var hashtagSpecialChars = "_\u200c\u200d\ua67e\u05be\u05f3\u05f4\uff5e\u301c\u309b\u309c\u30a0\u30fb\u3003\u0f0b\u0f0c\u00b7";
-+
-+  // A hashtag must contain at least one unicode letter or mark, as well as numbers, underscores, and select special characters.
-   twttr.txt.regexen.hashSigns = /[##]/;
--  twttr.txt.regexen.hashtagAlpha = regexSupplant(/[a-z_#{latinAccentChars}#{nonLatinHashtagChars}]/i);
--  twttr.txt.regexen.hashtagAlphaNumeric = regexSupplant(/[a-z0-9_#{latinAccentChars}#{nonLatinHashtagChars}]/i);
-+  twttr.txt.regexen.hashtagAlpha = new RegExp("[" + unicodeLettersAndMarks + "]");
-+  twttr.txt.regexen.hashtagAlphaNumeric = new RegExp("[" + unicodeLettersAndMarks + unicodeNumbers + hashtagSpecialChars + "]");
-   twttr.txt.regexen.endHashtagMatch = regexSupplant(/^(?:#{hashSigns}|:\/\/)/);
--  twttr.txt.regexen.hashtagBoundary = regexSupplant(/(?:^|$|[^&a-z0-9_#{latinAccentChars}#{nonLatinHashtagChars}])/);
--  twttr.txt.regexen.validHashtag = regexSupplant(/(#{hashtagBoundary})(#{hashSigns})(#{hashtagAlphaNumeric}*#{hashtagAlpha}#{hashtagAlphaNumeric}*)/gi);
-+  twttr.txt.regexen.hashtagBoundary = new RegExp("(?:^|$|[^&" + unicodeLettersAndMarks + unicodeNumbers + hashtagSpecialChars + "])");
-+  twttr.txt.regexen.validHashtag = regexSupplant(/(#{hashtagBoundary})(#{hashSigns})(?!\ufe0f|\u20e3)(#{hashtagAlphaNumeric}*#{hashtagAlpha}#{hashtagAlphaNumeric}*)/gi);
- 
-   // Mention related regex collection
--  twttr.txt.regexen.validMentionPrecedingChars = /(?:^|[^a-zA-Z0-9_!#$%&*@@]|RT:?)/;
-+  twttr.txt.regexen.validMentionPrecedingChars = /(?:^|[^a-zA-Z0-9_!#$%&*@@]|(?:^|[^a-zA-Z0-9_+~.-])(?:rt|RT|rT|Rt):?)/;
-   twttr.txt.regexen.atSigns = /[@@]/;
-   twttr.txt.regexen.validMentionOrList = regexSupplant(
-     '(#{validMentionPrecedingChars})' +  // $1: Preceding character
-@@ -252,30 +182,110 @@ var window = {};
-   twttr.txt.regexen.validDomainChars = regexSupplant(/[^#{invalidDomainChars}]/);
-   twttr.txt.regexen.validSubdomain = regexSupplant(/(?:(?:#{validDomainChars}(?:[_-]|#{validDomainChars})*)?#{validDomainChars}\.)/);
-   twttr.txt.regexen.validDomainName = regexSupplant(/(?:(?:#{validDomainChars}(?:-|#{validDomainChars})*)?#{validDomainChars}\.)/);
--  twttr.txt.regexen.validGTLD = regexSupplant(/(?:(?:aero|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|xxx)(?=[^0-9a-zA-Z]|$))/);
-+  twttr.txt.regexen.validGTLD = regexSupplant(RegExp(
-+    '(?:(?:' +
-+    'abb|abbott|abogado|academy|accenture|accountant|accountants|aco|active|actor|ads|adult|aeg|aero|' +
-+    'afl|agency|aig|airforce|airtel|allfinanz|alsace|amsterdam|android|apartments|app|aquarelle|' +
-+    'archi|army|arpa|asia|associates|attorney|auction|audio|auto|autos|axa|azure|band|bank|bar|' +
-+    'barcelona|barclaycard|barclays|bargains|bauhaus|bayern|bbc|bbva|bcn|beer|bentley|berlin|best|' +
-+    'bet|bharti|bible|bid|bike|bing|bingo|bio|biz|black|blackfriday|bloomberg|blue|bmw|bnl|' +
-+    'bnpparibas|boats|bond|boo|boots|boutique|bradesco|bridgestone|broker|brother|brussels|budapest|' +
-+    'build|builders|business|buzz|bzh|cab|cafe|cal|camera|camp|cancerresearch|canon|capetown|capital|' +
-+    'caravan|cards|care|career|careers|cars|cartier|casa|cash|casino|cat|catering|cba|cbn|ceb|center|' +
-+    'ceo|cern|cfa|cfd|chanel|channel|chat|cheap|chloe|christmas|chrome|church|cisco|citic|city|' +
-+    'claims|cleaning|click|clinic|clothing|cloud|club|coach|codes|coffee|college|cologne|com|' +
-+    'commbank|community|company|computer|condos|construction|consulting|contractors|cooking|cool|' +
-+    'coop|corsica|country|coupons|courses|credit|creditcard|cricket|crown|crs|cruises|cuisinella|' +
-+    'cymru|cyou|dabur|dad|dance|date|dating|datsun|day|dclk|deals|degree|delivery|delta|democrat|' +
-+    'dental|dentist|desi|design|dev|diamonds|diet|digital|direct|directory|discount|dnp|docs|dog|' +
-+    'doha|domains|doosan|download|drive|durban|dvag|earth|eat|edu|education|email|emerck|energy|' +
-+    'engineer|engineering|enterprises|epson|equipment|erni|esq|estate|eurovision|eus|events|everbank|' +
-+    'exchange|expert|exposed|express|fage|fail|faith|family|fan|fans|farm|fashion|feedback|film|' +
-+    'finance|financial|firmdale|fish|fishing|fit|fitness|flights|florist|flowers|flsmidth|fly|foo|' +
-+    'football|forex|forsale|forum|foundation|frl|frogans|fund|furniture|futbol|fyi|gal|gallery|game|' +
-+    'garden|gbiz|gdn|gent|genting|ggee|gift|gifts|gives|giving|glass|gle|global|globo|gmail|gmo|gmx|' +
-+    'gold|goldpoint|golf|goo|goog|google|gop|gov|graphics|gratis|green|gripe|group|guge|guide|' +
-+    'guitars|guru|hamburg|hangout|haus|healthcare|help|here|hermes|hiphop|hitachi|hiv|hockey|' +
-+    'holdings|holiday|homedepot|homes|honda|horse|host|hosting|hoteles|hotmail|house|how|hsbc|ibm|' +
-+    'icbc|ice|icu|ifm|iinet|immo|immobilien|industries|infiniti|info|ing|ink|institute|insure|int|' +
-+    'international|investments|ipiranga|irish|ist|istanbul|itau|iwc|java|jcb|jetzt|jewelry|jlc|jll|' +
-+    'jobs|joburg|jprs|juegos|kaufen|kddi|kim|kitchen|kiwi|koeln|komatsu|krd|kred|kyoto|lacaixa|' +
-+    'lancaster|land|lasalle|lat|latrobe|law|lawyer|lds|lease|leclerc|legal|lexus|lgbt|liaison|lidl|' +
-+    'life|lighting|limited|limo|link|live|lixil|loan|loans|lol|london|lotte|lotto|love|ltda|lupin|' +
-+    'luxe|luxury|madrid|maif|maison|man|management|mango|market|marketing|markets|marriott|mba|media|' +
-+    'meet|melbourne|meme|memorial|men|menu|miami|microsoft|mil|mini|mma|mobi|moda|moe|mom|monash|' +
-+    'money|montblanc|mormon|mortgage|moscow|motorcycles|mov|movie|movistar|mtn|mtpc|museum|nadex|' +
-+    'nagoya|name|navy|nec|net|netbank|network|neustar|new|news|nexus|ngo|nhk|nico|ninja|nissan|nokia|' +
-+    'nra|nrw|ntt|nyc|office|okinawa|omega|one|ong|onl|online|ooo|oracle|orange|org|organic|osaka|' +
-+    'otsuka|ovh|page|panerai|paris|partners|parts|party|pet|pharmacy|philips|photo|photography|' +
-+    'photos|physio|piaget|pics|pictet|pictures|pink|pizza|place|play|plumbing|plus|pohl|poker|porn|' +
-+    'post|praxi|press|pro|prod|productions|prof|properties|property|pub|qpon|quebec|racing|realtor|' +
-+    'realty|recipes|red|redstone|rehab|reise|reisen|reit|ren|rent|rentals|repair|report|republican|' +
-+    'rest|restaurant|review|reviews|rich|ricoh|rio|rip|rocks|rodeo|rsvp|ruhr|run|ryukyu|saarland|' +
-+    'sakura|sale|samsung|sandvik|sandvikcoromant|sanofi|sap|sarl|saxo|sca|scb|schmidt|scholarships|' +
-+    'school|schule|schwarz|science|scor|scot|seat|seek|sener|services|sew|sex|sexy|shiksha|shoes|' +
-+    'show|shriram|singles|site|ski|sky|skype|sncf|soccer|social|software|sohu|solar|solutions|sony|' +
-+    'soy|space|spiegel|spreadbetting|srl|starhub|statoil|studio|study|style|sucks|supplies|supply|' +
-+    'support|surf|surgery|suzuki|swatch|swiss|sydney|systems|taipei|tatamotors|tatar|tattoo|tax|taxi|' +
-+    'team|tech|technology|tel|telefonica|temasek|tennis|thd|theater|tickets|tienda|tips|tires|tirol|' +
-+    'today|tokyo|tools|top|toray|toshiba|tours|town|toyota|toys|trade|trading|training|travel|trust|' +
-+    'tui|ubs|university|uno|uol|vacations|vegas|ventures|vermögensberater|vermögensberatung|' +
-+    'versicherung|vet|viajes|video|villas|vin|vision|vista|vistaprint|vlaanderen|vodka|vote|voting|' +
-+    'voto|voyage|wales|walter|wang|watch|webcam|website|wed|wedding|weir|whoswho|wien|wiki|' +
-+    'williamhill|win|windows|wine|wme|work|works|world|wtc|wtf|xbox|xerox|xin|xperia|xxx|xyz|yachts|' +
-+    'yandex|yodobashi|yoga|yokohama|youtube|zip|zone|zuerich|дети|ком|москва|онлайн|орг|рус|сайт|קום|' +
-+    'بازار|شبكة|كوم|موقع|कॉम|नेट|संगठन|คอม|みんな|グーグル|コム|世界|中信|中文网|企业|佛山|信息|健康|八卦|公司|公益|商城|商店|商标|在线|大拿|' +
-+    '娱乐|工行|广东|慈善|我爱你|手机|政务|政府|新闻|时尚|机构|淡马锡|游戏|点看|移动|组织机构|网址|网店|网络|谷歌|集团|飞利浦|餐厅|닷넷|닷컴|삼성|onion' +
-+    ')(?=[^0-9a-zA-Z@]|$))'));
-   twttr.txt.regexen.validCCTLD = regexSupplant(RegExp(
--        "(?:(?:ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|" +
--        "ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|" +
--        "ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|" +
--        "ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|" +
--        "na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|" +
--        "sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|" +
--        "ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw)(?=[^0-9a-zA-Z]|$))"));
-+    '(?:(?:' +
-+    'ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bl|bm|bn|bo|bq|' +
-+    'br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|' +
-+    'ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|' +
-+    'gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|' +
-+    'la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mf|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|' +
-+    'my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|' +
-+    'rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|' +
-+    'tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|' +
-+    'бел|мкд|мон|рф|срб|укр|қаз|հայ|الاردن|الجزائر|السعودية|المغرب|امارات|ایران|بھارت|تونس|سودان|' +
-+    'سورية|عراق|عمان|فلسطين|قطر|مصر|مليسيا|پاکستان|भारत|বাংলা|ভারত|ਭਾਰਤ|ભારત|இந்தியா|இலங்கை|' +
-+    'சிங்கப்பூர்|భారత్|ලංකා|ไทย|გე|中国|中國|台湾|台灣|新加坡|澳門|香港|한국' +
-+    ')(?=[^0-9a-zA-Z@]|$))'));
-   twttr.txt.regexen.validPunycode = regexSupplant(/(?:xn--[0-9a-z]+)/);
-+  twttr.txt.regexen.validSpecialCCTLD = regexSupplant(RegExp(
-+    '(?:(?:co|tv)(?=[^0-9a-zA-Z@]|$))'));
-   twttr.txt.regexen.validDomain = regexSupplant(/(?:#{validSubdomain}*#{validDomainName}(?:#{validGTLD}|#{validCCTLD}|#{validPunycode}))/);
-   twttr.txt.regexen.validAsciiDomain = regexSupplant(/(?:(?:[\-a-z0-9#{latinAccentChars}]+)\.)+(?:#{validGTLD}|#{validCCTLD}|#{validPunycode})/gi);
--  twttr.txt.regexen.invalidShortDomain = regexSupplant(/^#{validDomainName}#{validCCTLD}$/);
-+  twttr.txt.regexen.invalidShortDomain = regexSupplant(/^#{validDomainName}#{validCCTLD}$/i);
-+  twttr.txt.regexen.validSpecialShortDomain = regexSupplant(/^#{validDomainName}#{validSpecialCCTLD}$/i);
- 
-   twttr.txt.regexen.validPortNumber = regexSupplant(/[0-9]+/);
- 
--  twttr.txt.regexen.validGeneralUrlPathChars = regexSupplant(/[a-z0-9!\*';:=\+,\.\$\/%#\[\]\-_~@|&#{latinAccentChars}]/i);
--  // Allow URL paths to contain balanced parens
-+  twttr.txt.regexen.cyrillicLettersAndMarks = regexSupplant("\u0400-\u04FF");
-+  twttr.txt.regexen.validGeneralUrlPathChars = regexSupplant(/[a-z#{cyrillicLettersAndMarks}0-9!\*';:=\+,\.\$\/%#\[\]\-_~@\|&#{latinAccentChars}]/i);
-+  // Allow URL paths to contain up to two nested levels of balanced parens
-   //  1. Used in Wikipedia URLs like /Primer_(film)
-   //  2. Used in IIS sessions like /S(dfd346)/
--  twttr.txt.regexen.validUrlBalancedParens = regexSupplant(/\(#{validGeneralUrlPathChars}+\)/i);
-+  //  3. Used in Rdio URLs like /track/We_Up_(Album_Version_(Edited))/
-+  twttr.txt.regexen.validUrlBalancedParens = regexSupplant(
-+    '\\('                                   +
-+      '(?:'                                 +
-+        '#{validGeneralUrlPathChars}+'      +
-+        '|'                                 +
-+        // allow one nested level of balanced parentheses
-+        '(?:'                               +
-+          '#{validGeneralUrlPathChars}*'    +
-+          '\\('                             +
-+            '#{validGeneralUrlPathChars}+'  +
-+          '\\)'                             +
-+          '#{validGeneralUrlPathChars}*'    +
-+        ')'                                 +
-+      ')'                                   +
-+    '\\)'
-+  , 'i');
-   // Valid end-of-path chracters (so /foo. does not gobble the period).
-   // 1. Allow =&# for empty URL parameters and other URL-join artifacts
--  twttr.txt.regexen.validUrlPathEndingChars = regexSupplant(/[\+\-a-z0-9=_#\/#{latinAccentChars}]|(?:#{validUrlBalancedParens})/i);
-+  twttr.txt.regexen.validUrlPathEndingChars = regexSupplant(/[\+\-a-z#{cyrillicLettersAndMarks}0-9=_#\/#{latinAccentChars}]|(?:#{validUrlBalancedParens})/i);
-   // Allow @ in a url, but only in the middle. Catch things like http://example.com/@user/
-   twttr.txt.regexen.validUrlPath = regexSupplant('(?:' +
-     '(?:' +
-@@ -309,7 +319,7 @@ var window = {};
-   twttr.txt.regexen.validCashtag = regexSupplant('(^|#{spaces})(\\$)(#{cashtag})(?=$|\\s|[#{punct}])', 'gi');
- 
-   // These URL validation pattern strings are based on the ABNF from RFC 3986
--  twttr.txt.regexen.validateUrlUnreserved = /[a-z0-9\-._~]/i;
-+  twttr.txt.regexen.validateUrlUnreserved = /[a-z\u0400-\u04FF0-9\-._~]/i;
-   twttr.txt.regexen.validateUrlPctEncoded = /(?:%[0-9a-f]{2})/i;
-   twttr.txt.regexen.validateUrlSubDelims = /[!$&'()*+,;=]/i;
-   twttr.txt.regexen.validateUrlPchar = regexSupplant('(?:' +
-@@ -478,7 +488,7 @@ var window = {};
-     attrs.href = options.hashtagUrlBase + hashtag;
-     attrs.title = "#" + hashtag;
-     attrs["class"] = options.hashtagClass;
--    if (hashtag[0].match(twttr.txt.regexen.rtl_chars)){
-+    if (hashtag.charAt(0).match(twttr.txt.regexen.rtl_chars)){
-       attrs["class"] += " rtl";
-     }
-     if (options.targetBlank) {
-@@ -683,22 +693,34 @@ var window = {};
-   };
- 
-   twttr.txt.autoLinkWithJSON = function(text, json, options) {
-+    // map JSON entity to twitter-text entity
-+    if (json.user_mentions) {
-+      for (var i = 0; i < json.user_mentions.length; i++) {
-+        // this is a @mention
-+        json.user_mentions[i].screenName = json.user_mentions[i].screen_name;
-+      }
-+    }
-+
-+    if (json.hashtags) {
-+      for (var i = 0; i < json.hashtags.length; i++) {
-+        // this is a #hashtag
-+        json.hashtags[i].hashtag = json.hashtags[i].text;
-+      }
-+    }
-+
-+    if (json.symbols) {
-+      for (var i = 0; i < json.symbols.length; i++) {
-+        // this is a $CASH tag
-+        json.symbols[i].cashtag = json.symbols[i].text;
-+      }
-+    }
-+
-     // concatenate all entities
-     var entities = [];
-     for (var key in json) {
-       entities = entities.concat(json[key]);
-     }
--    // map JSON entity to twitter-text entity
--    for (var i = 0; i < entities.length; i++) {
--      entity = entities[i];
--      if (entity.screen_name) {
--        // this is @mention
--        entity.screenName = entity.screen_name;
--      } else if (entity.text) {
--        // this is #hashtag
--        entity.hashtag = entity.text;
--      }
--    }
-+
-     // modify indices to UTF-16
-     twttr.txt.modifyIndicesFromUnicodeToUTF16(text, entities);
- 
-@@ -861,7 +883,6 @@ var window = {};
-     if (!options) {
-       options = {extractUrlsWithoutProtocol: true};
-     }
--
-     if (!text || (options.extractUrlsWithoutProtocol ? !text.match(/\./) : !text.match(/:/))) {
-       return [];
-     }
-@@ -881,7 +902,6 @@ var window = {};
-           continue;
-         }
-         var lastUrl = null,
--            lastUrlInvalidMatch = false,
-             asciiEndPosition = 0;
-         domain.replace(twttr.txt.regexen.validAsciiDomain, function(asciiDomain) {
-           var asciiStartPosition = domain.indexOf(asciiDomain, asciiEndPosition);
-@@ -890,8 +910,9 @@ var window = {};
-             url: asciiDomain,
-             indices: [startPosition + asciiStartPosition, startPosition + asciiEndPosition]
-           };
--          lastUrlInvalidMatch = asciiDomain.match(twttr.txt.regexen.invalidShortDomain);
--          if (!lastUrlInvalidMatch) {
-+          if (path
-+              || asciiDomain.match(twttr.txt.regexen.validSpecialShortDomain)
-+              || !asciiDomain.match(twttr.txt.regexen.invalidShortDomain)) {
-             urls.push(lastUrl);
-           }
-         });
-@@ -903,9 +924,6 @@ var window = {};
- 
-         // lastUrl only contains domain. Need to add path and query if they exist.
-         if (path) {
--          if (lastUrlInvalidMatch) {
--            urls.push(lastUrl);
--          }
-           lastUrl.url = url.replace(domain, lastUrl.url);
-           lastUrl.indices[1] = endPosition;
-         }
-@@ -1199,7 +1217,7 @@ var window = {};
-       options = {
-           // These come from https://api.twitter.com/1/help/configuration.json
-           // described by https://dev.twitter.com/docs/api/1/get/help/configuration
--          short_url_length: 22,
-+          short_url_length: 23,
-           short_url_length_https: 23
-       };
-     }
-@@ -1208,11 +1226,11 @@ var window = {};
-     twttr.txt.modifyIndicesFromUTF16ToUnicode(text, urlsWithIndices);
- 
-     for (var i = 0; i < urlsWithIndices.length; i++) {
--    	// Subtract the length of the original URL
-+      // Subtract the length of the original URL
-       textLength += urlsWithIndices[i].indices[0] - urlsWithIndices[i].indices[1];
- 
-       // Add 23 characters for URL starting with https://
--      // Otherwise add 22 characters
-+      // http:// URLs still use https://t.co so they are 23 characters as well
-       if (urlsWithIndices[i].url.toLowerCase().match(twttr.txt.regexen.urlHasHttps)) {
-          textLength += options.short_url_length_https;
-       } else {
-@@ -1242,12 +1260,19 @@ var window = {};
-       return "too_long";
-     }
- 
-+    if (twttr.txt.hasInvalidCharacters(text)) {
-+      return "invalid_characters";
-+    }
-+
-+    return false;
-+  };
-+
-+  twttr.txt.hasInvalidCharacters = function(text) {
-     for (var i = 0; i < INVALID_CHARACTERS.length; i++) {
-       if (text.indexOf(INVALID_CHARACTERS[i]) >= 0) {
--        return "invalid_characters";
-+        return true;
-       }
-     }
--
-     return false;
-   };
- 
-@@ -1339,6 +1364,10 @@ var window = {};
-     module.exports = twttr.txt;
-   }
- 
-+  if (typeof define == 'function' && define.amd) {
-+    define([], twttr.txt);
-+  }
-+
-   if (typeof window != 'undefined') {
-     if (window.twttr) {
-       for (var prop in twttr) {
+diff --git a/chat/modules/imContentSink.jsm b/chat/modules/imContentSink.jsm
+index ee067af..abd95fc 100644
+--- a/chat/modules/imContentSink.jsm
++++ b/chat/modules/imContentSink.jsm
+@@ -47,6 +47,7 @@ var kAllowedMozClasses =
+   aClassName => aClassName == "moz-txt-underscore" ||
+                 aClassName == "moz-txt-tag" ||
+                 aClassName == "ib-person";
++var kAllowedAnchorClasses = aClassName => aClassName == "ib-person";
+ 
+ /* Tags whose content should be fully removed, and reported in the Error Console. */
+ var kForbiddenTags = {
+@@ -61,7 +62,8 @@ var kStrictMode = {
+   tags: {
+     'a': {
+       'title': true,
+-      'href': kAllowedURLs
++      'href': kAllowedURLs,
++      'class': kAllowedAnchorClasses
+     },
+     'br': true,
+     'p': true
+@@ -80,7 +82,8 @@ var kStandardMode = {
+     'div': true,
+     'a': {
+       'title': true,
+-      'href': kAllowedURLs
++      'href': kAllowedURLs,
++      'class': kAllowedAnchorClasses
+     },
+     'em': true,
+     'strong': true,
+@@ -117,7 +120,8 @@ var kPermissiveMode = {
+     'div': true,
+     'a': {
+       'title': true,
+-      'href': kAllowedURLs
++      'href': kAllowedURLs,
++      'class': kAllowedAnchorClasses
+     },
+     'font': {
+       'face': true,
 diff --git a/chat/protocols/twitter/twitter.js b/chat/protocols/twitter/twitter.js
-index fac9c56..af5e4d5 100644
+index 59f60cc..4d8e04c 100644
 --- a/chat/protocols/twitter/twitter.js
 +++ b/chat/protocols/twitter/twitter.js
 @@ -36,8 +36,11 @@ ChatBuddy.prototype = {
@@ -464,182 +82,131 @@ index fac9c56..af5e4d5 100644
  
  function Tweet(aTweet, aWho, aMessage, aObject)
  {
-@@ -51,7 +54,12 @@ Tweet.prototype = {
-     let account = this.conversation._account;
-     let actions = [];
- 
--    if (account.connected) {
+@@ -48,6 +51,13 @@ Tweet.prototype = {
+   __proto__: GenericMessagePrototype,
+   _deleted: false,
+   getActions: function(aCount) {
++    // Direct messages have no actions.
 +    if (!this.conversation.isChat) {
 +      if (aCount)
-+        aCount.value = actions.length;
-+      return actions;
++        aCount.value = 0;
++      return [];
 +    }
-+    else if (account.connected) {
-       actions.push(
-         new Action(_("action.reply"), function() {
-           this.conversation.startReply(this._tweet);
-@@ -123,13 +131,109 @@ Action.prototype = {
++
+     let account = this.conversation._account;
+     let actions = [];
+ 
+@@ -68,6 +78,11 @@ Tweet.prototype = {
+         let screenName = this._tweet.user.screen_name;
+         actions.push(new Action(_("action." + action, screenName),
+                                 function() { account[action](screenName); }));
++
++        const favAction = this._tweet.favorited ? "unlike" : "like";
++        actions.push(new Action(_("action." + favAction), () => {
++          this.conversation.like(this._tweet, this._tweet.favorited);
++        }, this));
+       }
+       else if (this.outgoing && !this._deleted) {
+         actions.push(
+@@ -123,83 +138,13 @@ Action.prototype = {
    get run() { return this._action.bind(this._tweet); }
  };
  
 -function Conversation(aAccount)
-+// Properties / methods shared by both DirectMessageConversation and
-+// TimelineConversation.
-+var GenericTwitterConversation = {
-+  getTweetLength: function (aString) {
-+    // Use the Twitter library to calculate the length.
-+    return twttr.txt.getTweetLength(aString, this._account.config);
-+  },
-+  systemMessage: function(aMessage, aIsError, aDate) {
-+    let flags = {system: true};
-+    if (aIsError)
-+      flags.error = true;
-+    if (aDate)
-+      flags.time = aDate;
-+    this.writeMessage("twitter.com", aMessage, flags);
-+  },
-+  onSentCallback: function(aMsg, aData) {
-+    // The conversation may have been unitialized in the time it takes for
-+    // the async callback to fire.  Use `_observers` as a proxy for uninit'd.
-+    if (!Array.isArray(this._observers))
-+      return;
-+
-+    let tweet = JSON.parse(aData);
-+    // The OTR extension requires that the protocol not modify the message
-+    // (see the notes at `imIOutgoingMessage`).  That's the contract we made.
-+    // Unfortunately, Twitter trims tweets and substitutes links.
-+    tweet.text = aMsg;
-+    this.displayMessages([tweet]);
-+  },
-+  prepareForDisplaying: function(aMsg) {
-+    let text = aMsg.displayMessage;
-+    let tweet = aMsg.wrappedJSObject.prplMessage.wrappedJSObject._tweet;
-+
-+    // Handle retweets: retweeted_status contains the object for the original
-+    // tweet that is being retweeted.
-+    // If the retweet prefix ("RT @<username>: ") causes the tweet to be over
-+    // 140 characters, ellipses will be added. In this case, we want to get
-+    // the FULL text from the original tweet and update the entities to match.
-+    // Note: the truncated flag is not always set correctly by twitter, so we
-+    // always make use of the original tweet.
-+    if ("retweeted_status" in tweet) {
-+      let retweet = tweet["retweeted_status"];
-+      // We're going to take portions of the retweeted status and replace parts
-+      // of the original tweet, the retweeted status prepends the original
-+      // status with "RT @<username>: ", we need to keep the prefix.
-+      // Note: this doesn't play nice with extensions that may have altered
-+      // `text` to this point, but at least OTR doesn't act on `isChat`.
-+      let offset = text.indexOf(": ") + 2;
-+      text = text.slice(0, offset) + retweet.text;
-+    }
-+
-+    // Pass in the url entities so the t.co links are replaced.
-+    aMsg.displayMessage = twttr.txt.autoLink(text, {
-+      urlEntities: tweet.entities.urls.map(function(u) {
-+        var o = Object.assign(u);
-+        // But remove the indices so they apply in the face of modifications.
-+        delete o.indices;
-+        return o;
-+      })
-+    });
-+
-+    GenericConversationPrototype.prepareForDisplaying.apply(this, arguments);
-+  },
-+  displayTweet: function(aTweet, aUser) {
-+    let name = aUser.screen_name;
-+
-+    let flags = name == this.nick ? {outgoing: true} : {incoming: true};
-+    flags.time = Math.round(new Date(aTweet.created_at) / 1000);
-+    flags._iconURL = aUser.profile_image_url;
-+    if (aTweet.delayed)
-+      flags.delayed = true;
-+    if (aTweet.entities && aTweet.entities.user_mentions &&
-+        Array.isArray(aTweet.entities.user_mentions) &&
-+        aTweet.entities.user_mentions.some(mention => mention.screen_name == this.nick))
-+      flags.containsNick = true;
-+
-+    (new Tweet(aTweet, name, aTweet.text, flags)).conversation = this;
-+  },
-+  _parseError: function(aData) {
-+    let error = "";
-+    try {
-+      let data = JSON.parse(aData);
-+      if ("error" in data)
-+        error = data.error;
-+      else if ("errors" in data)
-+        error = data.errors[0].message;
-+      if (error)
-+        error = "(" + error + ")";
-+    } catch(e) {}
-+    return error;
-+  }
-+};
-+
-+function TimelineConversation(aAccount)
- {
-   this._init(aAccount);
-   this._ensureParticipantExists(aAccount.name);
-   // We need the screen names for the IDs in _friends, but _userInfo is
-   // indexed by name, so we build an ID -> name map.
+-{
+-  this._init(aAccount);
+-  this._ensureParticipantExists(aAccount.name);
+-  // We need the screen names for the IDs in _friends, but _userInfo is
+-  // indexed by name, so we build an ID -> name map.
 -  let names = new Map([userInfo.id_str, name] for ([name, userInfo] of aAccount._userInfo));
-+  let entries = [];
-+  for (let [name, userInfo] of aAccount._userInfo) {
-+    entries.push([userInfo.id_str, name]);
-+  }
-+  let names = new Map(entries);
-   for (let id_str of aAccount._friends)
-     this._ensureParticipantExists(names.get(id_str));
- 
-@@ -140,7 +244,7 @@ function Conversation(aAccount)
-       this.setTopic(userInfo.description, aAccount.name, true);
-   }
- }
+-  for (let id_str of aAccount._friends)
+-    this._ensureParticipantExists(names.get(id_str));
+-
+-  // If the user's info has already been received, update the timeline topic.
+-  if (aAccount._userInfo.has(aAccount.name)) {
+-    let userInfo = aAccount._userInfo.get(aAccount.name);
+-    if ("description" in userInfo)
+-      this.setTopic(userInfo.description, aAccount.name, true);
+-  }
+-}
 -Conversation.prototype = {
-+TimelineConversation.prototype = {
-   __proto__: GenericConvChatPrototype,
-   unInit: function() {
-     delete this._account._timeline;
-@@ -170,22 +274,18 @@ Conversation.prototype = {
-                          _("replyingToStatusText", aTweet.text));
-   },
-   reTweet: function(aTweet) {
+-  __proto__: GenericConvChatPrototype,
+-  unInit: function() {
+-    delete this._account._timeline;
+-    GenericConvChatPrototype.unInit.call(this);
+-  },
+-  inReplyToStatusId: null,
+-  startReply: function(aTweet) {
+-    this.inReplyToStatusId = aTweet.id_str;
+-    let entities = aTweet.entities;
+-
+-    // Twitter replies go to all the users mentioned in the tweet.
+-    let nicks = [aTweet.user.screen_name];
+-    if ("user_mentions" in entities && Array.isArray(entities.user_mentions)) {
+-      nicks = nicks.concat(entities.user_mentions
+-                                   .map(um => um.screen_name));
+-    }
+-    // Ignore duplicates and the user's nick.
+-    let prompt =
+-      nicks.filter(function(aNick, aPos) {
+-             return nicks.indexOf(aNick) == aPos && aNick != this._account.name;
+-           }, this)
+-           .map(aNick => "@" + aNick)
+-           .join(" ") + " ";
+-
+-    this.notifyObservers(null, "replying-to-prompt", prompt);
+-    this.notifyObservers(null, "status-text-changed",
+-                         _("replyingToStatusText", aTweet.text));
+-  },
+-  reTweet: function(aTweet) {
 -    this._account.reTweet(aTweet, this.onSentCallback,
 -                          function(aException, aData) {
-+    this._account.reTweet(aTweet, null, function(aException, aData) {
-       this.systemMessage(_("error.retweet", this._parseError(aData),
-                            aTweet.text), true);
-     }, this);
-   },
--  getTweetLength: function (aString) {
--    // Use the Twitter library to calculate the length.
--    return twttr.txt.getTweetLength(aString, this._account.config);
+-      this.systemMessage(_("error.retweet", this._parseError(aData),
+-                           aTweet.text), true);
+-    }, this);
 -  },
++// Properties / methods shared by both DirectMessageConversation and
++// TimelineConversation.
++var GenericTwitterConversation = {
+   getTweetLength: function (aString) {
+     // Use the Twitter library to calculate the length.
+     return twttr.txt.getTweetLength(aString, this._account.config);
+   },
 -  sendMsg: function (aMsg) {
-+  sendMsg: function(aMsg) {
-     if (this.getTweetLength(aMsg) > kMaxMessageLength) {
-       this.systemMessage(_("error.tooLong"), true);
-       throw Cr.NS_ERROR_INVALID_ARG;
-     }
+-    if (this.getTweetLength(aMsg) > kMaxMessageLength) {
+-      this.systemMessage(_("error.tooLong"), true);
+-      throw Cr.NS_ERROR_INVALID_ARG;
+-    }
 -    this._account.tweet(aMsg, this.inReplyToStatusId, this.onSentCallback,
-+    this._account.tweet(aMsg, this.inReplyToStatusId,
-+                        this.onSentCallback.bind(this, aMsg),
-                         function(aException, aData) {
-       let error = this._parseError(aData);
-       this.systemMessage(_("error.general", error, aMsg), true);
-@@ -200,163 +300,30 @@ Conversation.prototype = {
-     }
-     return kMaxMessageLength - this.getTweetLength(aString);
-   },
--  systemMessage: function(aMessage, aIsError, aDate) {
--    let flags = {system: true};
--    if (aIsError)
--      flags.error = true;
--    if (aDate)
--      flags.time = aDate;
--    this.writeMessage("twitter.com", aMessage, flags);
+-                        function(aException, aData) {
+-      let error = this._parseError(aData);
+-      this.systemMessage(_("error.general", error, aMsg), true);
+-    }, this);
+-    this.sendTyping("");
 -  },
+-  sendTyping: function(aString) {
+-    if (aString.length == 0 && this.inReplyToStatusId) {
+-      delete this.inReplyToStatusId;
+-      this.notifyObservers(null, "status-text-changed", "");
+-      return kMaxMessageLength;
+-    }
+-    return kMaxMessageLength - this.getTweetLength(aString);
+-  },
+   systemMessage: function(aMessage, aIsError, aDate) {
+     let flags = {system: true};
+     if (aIsError)
+@@ -208,27 +153,26 @@ Conversation.prototype = {
+       flags.time = aDate;
+     this.writeMessage("twitter.com", aMessage, flags);
+   },
 -  onSentCallback: function(aData) {
--    let tweet = JSON.parse(aData);
++  onSentCallback: function(aMsg, aData) {
++    // The conversation may have been unitialized in the time it takes for
++    // the async callback to fire.  Use `_observers` as a proxy for uninit'd.
++    if (!this._observers)
++      return;
++
+     let tweet = JSON.parse(aData);
 -    if (tweet.user.screen_name != this._account.name)
 -      throw "Wrong screen_name... Uh?";
 -    this._account.displayMessages([tweet]);
@@ -656,78 +223,89 @@ index fac9c56..af5e4d5 100644
 -        error = "(" + error + ")";
 -    } catch(e) {}
 -    return error;
--  },
++    // The OTR extension requires that the protocol not modify the message
++    // (see the notes at `imIOutgoingMessage`).  That's the contract we made.
++    // Unfortunately, Twitter trims tweets and substitutes links.
++    tweet.text = aMsg;
++    this.displayMessages([tweet]);
+   },
 -  parseTweet: function(aTweet) {
 -    let text = aTweet.text;
--    let entities = {};
--    // Handle retweets: retweeted_status contains the object for the original
--    // tweet that is being retweeted.
--    // If the retweet prefix ("RT @<username>: ") causes the tweet to be over
--    // 140 characters, ellipses will be added. In this case, we want to get
--    // the FULL text from the original tweet and update the entities to match.
--    // Note: the truncated flag is not always set correctly by twitter, so we
--    // always make use of the original tweet.
++  prepareForDisplaying: function(aMsg) {
++    if (!this._tweets.has(aMsg.id))
++      return;
++    let tweet = this._tweets.get(aMsg.id)._tweet;
++    this._tweets.delete(aMsg.id);
++
++    let text = aMsg.displayMessage;
+     let entities = {};
+ 
+     // Handle retweets: retweeted_status contains the object for the original
+@@ -238,8 +182,8 @@ Conversation.prototype = {
+     // the FULL text from the original tweet and update the entities to match.
+     // Note: the truncated flag is not always set correctly by twitter, so we
+     // always make use of the original tweet.
 -    if ("retweeted_status" in aTweet) {
 -      let retweet = aTweet["retweeted_status"];
--      // We're going to take portions of the retweeted status and replace parts
--      // of the original tweet, the retweeted status prepends the original
--      // status with "RT @<username>: ", we need to keep the prefix.
--      let offset = text.indexOf(": ") + 2;
--      text = text.slice(0, offset) + retweet.text;
--
--      // Keep any entities that refer to the prefix (we can refer directly to
++    if ("retweeted_status" in tweet) {
++      let retweet = tweet["retweeted_status"];
+       let retweetText, retweetEntities = {};
+ 
+       if ("extended_tweet" in retweet) {
+@@ -259,22 +203,24 @@ Conversation.prototype = {
+       // We're going to take portions of the retweeted status and replace parts
+       // of the original tweet, the retweeted status prepends the original
+       // status with "RT @<username>: ", we need to keep the prefix.
++      // Note: this doesn't play nice with extensions that may have altered
++      // `text` to this point, but at least OTR doesn't act on `isChat`.
+       let offset = text.indexOf(": ") + 2;
+       text = text.slice(0, offset) + retweetText;
+ 
+       // Keep any entities that refer to the prefix (we can refer directly to
 -      // aTweet for these since they are not edited).
 -      if ("entities" in aTweet) {
 -        for (let type in aTweet.entities) {
--          let filteredEntities =
++      // the tweet for these since they are not edited).
++      if ("entities" in tweet) {
++        for (let type in tweet.entities) {
+           let filteredEntities =
 -            aTweet.entities[type].filter(e => e.indices[0] < offset);
--          if (filteredEntities.length)
--            entities[type] = filteredEntities;
--        }
--      }
-+  displayMessages: function(aMessages) {
-+    let account = this._account;
-+    let lastMsgId = account._lastMsgId;
-+    for (let tweet of aMessages) {
-+      if (!("user" in tweet) || !("text" in tweet) || !("id_str" in tweet) ||
-+          account._knownMessageIds.has(tweet.id_str))
-+        continue;
-+      let id = tweet.id_str;
-+      // Update the last known message.
-+      // Compare the length of the ids first, and then the text.
-+      // This avoids converting tweet ids into rounded numbers.
-+      if (id.length > lastMsgId.length ||
-+          (id.length == lastMsgId.length && id > lastMsgId))
-+        lastMsgId = id;
-+      account._knownMessageIds.add(id);
-+      account.setUserInfo(tweet.user);
++            tweet.entities[type].filter(e => e.indices[0] < offset);
+           if (filteredEntities.length)
+             entities[type] = filteredEntities;
+         }
+       }
  
--      // Add the entities from the retweet (a copy of these must be made since
+       // Add the entities from the retweet (a copy of these must be made since
 -      // they will be edited and we do not wish to change aTweet).
--      if ("entities" in retweet) {
--        for (let type in retweet.entities) {
--          if (!(type in entities))
--            entities[type] = [];
--
--          // Append the entities from the original status.
--          entities[type] = entities[type].concat(
--            retweet.entities[type].map(function(aEntity) {
--              let entity = Object.create(aEntity);
--              // Add the offset to the indices to account for the prefix.
--              entity.indices = entity.indices.map(i => i + offset);
--              return entity;
--            })
--          );
--        }
--      }
--    } else {
--      // For non-retweets, we just want to use the entities that are given.
++      // they will be edited and we do not wish to change the tweet).
+       for (let type in retweetEntities) {
+         if (!(type in entities))
+           entities[type] = [];
+@@ -288,90 +234,41 @@ Conversation.prototype = {
+             return entity;
+           })
+         );
+-       }
+-    } else if ("extended_tweet" in aTweet) {
++      }
++    } else if ("extended_tweet" in tweet) {
+       // Bare bones extended tweet handling.
+-      let extended = aTweet.extended_tweet;
++      let extended = tweet.extended_tweet;
+       text = extended.full_text;
+       if ("entities" in extended)
+         entities = extended.entities;
+     } else {
+       // For non-retweets, we just want to use the entities that are given.
 -      if ("entities" in aTweet)
 -        entities = aTweet.entities;
-+      this._ensureParticipantExists(tweet.user.screen_name);
-+      this.displayTweet(tweet, tweet.user);
++      if ("entities" in tweet)
++        entities = tweet.entities;
      }
--
+ 
+     this._account.LOG("Tweet: " + text);
+ 
 -    if (Object.keys(entities).length) {
 -      /* entArray is an array of entities ready to be replaced in the tweet,
 -       * each entity contains:
@@ -784,34 +362,179 @@ index fac9c56..af5e4d5 100644
 -               text.slice(offset + entity.end);
 -        offset += html.length - (entity.end - entity.start);
 -      }
-+    if (lastMsgId != account._lastMsgId) {
-+      account._lastMsgId = lastMsgId;
-+      account.prefs.setCharPref("lastMessageId", account._lastMsgId);
-     }
--
+-    }
++    aMsg.displayMessage = twttr.txt.autoLink(text, {
++      usernameClass: "ib-person",
++      usernameIncludeSymbol: true,
++      // Pass in the url entities so the t.co links are replaced.
++      urlEntities: tweet.entities.urls.map(function(u) {
++        let o = Object.assign(u);
++        // But remove the indices so they apply in the face of modifications.
++        delete o.indices;
++        return o;
++      })
++    });
+ 
 -    return text;
--  },
++    GenericConversationPrototype.prepareForDisplaying.apply(this, arguments);
+   },
 -  displayTweet: function(aTweet) {
 -    let name = aTweet.user.screen_name;
 -    this._ensureParticipantExists(name);
 -    let text = this.parseTweet(aTweet);
--
++  displayTweet: function(aTweet, aUser) {
++    let name = aUser.screen_name;
+ 
 -    let flags =
 -      name == this._account.name ? {outgoing: true} : {incoming: true};
--    flags.time = Math.round(new Date(aTweet.created_at) / 1000);
++    let flags = name == this.nick ? {outgoing: true} : {incoming: true};
+     flags.time = Math.round(new Date(aTweet.created_at) / 1000);
 -    flags._iconURL = aTweet.user.profile_image_url;
--    if (aTweet.delayed)
--      flags.delayed = true;
--    if (aTweet.entities && aTweet.entities.user_mentions &&
--        Array.isArray(aTweet.entities.user_mentions) &&
--        aTweet.entities.user_mentions.some(mention => mention.screen_name == this.nick))
--      flags.containsNick = true;
--
++    flags._iconURL = aUser.profile_image_url;
+     if (aTweet.delayed)
+       flags.delayed = true;
+     if (aTweet.entities && aTweet.entities.user_mentions &&
+@@ -379,7 +276,138 @@ Conversation.prototype = {
+         aTweet.entities.user_mentions.some(mention => mention.screen_name == this.nick))
+       flags.containsNick = true;
+ 
 -    (new Tweet(aTweet, name, text, flags)).conversation = this;
++    let tweet = new Tweet(aTweet, name, aTweet.text, flags);
++    this._tweets.set(tweet.id, tweet);
++    tweet.conversation = this;
++  },
++  _parseError: function(aData) {
++    let error = "";
++    try {
++      let data = JSON.parse(aData);
++      if ("error" in data)
++        error = data.error;
++      else if ("errors" in data)
++        error = data.errors[0].message;
++      if (error)
++        error = "(" + error + ")";
++    } catch(e) {}
++    return error;
++  },
++  getNormalizedChatBuddyName: (aNick) => aNick.replace(/^@/, "")
++};
++
++function TimelineConversation(aAccount)
++{
++  this._init(aAccount);
++  this._ensureParticipantExists(aAccount.name);
++  // We need the screen names for the IDs in _friends, but _userInfo is
++  // indexed by name, so we build an ID -> name map.
++  let entries = [];
++  for (let [name, userInfo] of aAccount._userInfo) {
++    entries.push([userInfo.id_str, name]);
++  }
++  let names = new Map(entries);
++  for (let id_str of aAccount._friends)
++    this._ensureParticipantExists(names.get(id_str));
++
++  // If the user's info has already been received, update the timeline topic.
++  if (aAccount._userInfo.has(aAccount.name)) {
++    let userInfo = aAccount._userInfo.get(aAccount.name);
++    if ("description" in userInfo)
++      this.setTopic(userInfo.description, aAccount.name, true);
++  }
++
++  // Store messages by message id.
++  this._tweets = new Map();
++}
++TimelineConversation.prototype = {
++  __proto__: GenericConvChatPrototype,
++  unInit: function() {
++    delete this._account._timeline;
++    GenericConvChatPrototype.unInit.call(this);
++  },
++  inReplyToStatusId: null,
++  startReply: function(aTweet) {
++    this.inReplyToStatusId = aTweet.id_str;
++    let entities = aTweet.entities;
++
++    // Twitter replies go to all the users mentioned in the tweet.
++    let nicks = [aTweet.user.screen_name];
++    if ("user_mentions" in entities && Array.isArray(entities.user_mentions)) {
++      nicks = nicks.concat(entities.user_mentions
++                                   .map(um => um.screen_name));
++    }
++    // Ignore duplicates and the user's nick.
++    let prompt =
++      nicks.filter(function(aNick, aPos) {
++             return nicks.indexOf(aNick) == aPos && aNick != this._account.name;
++           }, this)
++           .map(aNick => "@" + aNick)
++           .join(" ") + " ";
++
++    this.notifyObservers(null, "replying-to-prompt", prompt);
++    this.notifyObservers(null, "status-text-changed",
++                         _("replyingToStatusText", aTweet.text));
++  },
++  reTweet: function(aTweet) {
++    this._account.reTweet(aTweet, null, function(aException, aData) {
++      this.systemMessage(_("error.retweet", this._parseError(aData),
++                           aTweet.text), true);
++    }, this);
++  },
++  sendMsg: function(aMsg) {
++    if (this.getTweetLength(aMsg) > kMaxMessageLength) {
++      this.systemMessage(_("error.tooLong"), true);
++      throw Cr.NS_ERROR_INVALID_ARG;
++    }
++    this._account.tweet(aMsg, this.inReplyToStatusId,
++                        this.onSentCallback.bind(this, aMsg),
++                        function(aException, aData) {
++      let error = this._parseError(aData);
++      this.systemMessage(_("error.general", error, aMsg), true);
++    }, this);
++    this.sendTyping("");
++  },
++  like: function(aTweet, aRemoveLike = false) {
++    this._account.like(aTweet, aRemoveLike, function() {
++      aTweet.favorited = !aRemoveLike;
++    }, function(aException, aData) {
++      const messageName = aRemoveLike ? "unlike" : "like";
++      this.systemMessage(_("error." + messageName,
++                          this.parseError(aData), aTweet.text), true);
++    }, this);
++  },
++  sendTyping: function(aString) {
++    if (aString.length == 0 && this.inReplyToStatusId) {
++      delete this.inReplyToStatusId;
++      this.notifyObservers(null, "status-text-changed", "");
++      return kMaxMessageLength;
++    }
++    return kMaxMessageLength - this.getTweetLength(aString);
++  },
++  displayMessages: function(aMessages) {
++    let account = this._account;
++    let lastMsgId = account._lastMsgId;
++    for (let tweet of aMessages) {
++      if (!("user" in tweet) || !("text" in tweet) || !("id_str" in tweet) ||
++          account._knownMessageIds.has(tweet.id_str))
++        continue;
++      let id = tweet.id_str;
++      // Update the last known message.
++      // Compare the length of the ids first, and then the text.
++      // This avoids converting tweet ids into rounded numbers.
++      if (id.length > lastMsgId.length ||
++          (id.length == lastMsgId.length && id > lastMsgId))
++        lastMsgId = id;
++      account._knownMessageIds.add(id);
++      account.setUserInfo(tweet.user);
++      this._ensureParticipantExists(tweet.user.screen_name);
++      this.displayTweet(tweet, tweet.user);
++    }
++    if (lastMsgId != account._lastMsgId) {
++      account._lastMsgId = lastMsgId;
++      account.prefs.setCharPref("lastMessageId", account._lastMsgId);
++    }
    },
    _ensureParticipantExists: function(aNick) {
      if (this._participants.has(aNick))
-@@ -378,6 +345,41 @@ Conversation.prototype = {
+@@ -401,6 +429,44 @@ Conversation.prototype = {
        this._account.setUserDescription(aTopic);
    }
  };
@@ -820,6 +543,9 @@ index fac9c56..af5e4d5 100644
 +function DirectMessageConversation(aAccount, aName)
 +{
 +  this._init(aAccount, aName);
++
++  // Store messages by message id.
++  this._tweets = new Map();
 +}
 +DirectMessageConversation.prototype = {
 +  __proto__: GenericConvIMPrototype,
@@ -853,7 +579,7 @@ index fac9c56..af5e4d5 100644
  
  function Account(aProtocol, aImAccount)
  {
-@@ -385,15 +387,12 @@ function Account(aProtocol, aImAccount)
+@@ -408,6 +474,8 @@ function Account(aProtocol, aImAccount)
    this._knownMessageIds = new Set();
    this._userInfo = new Map();
    this._friends = new Set();
@@ -862,16 +588,7 @@ index fac9c56..af5e4d5 100644
  }
  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/",
-@@ -512,7 +511,7 @@ Account.prototype = {
+@@ -535,7 +603,7 @@ Account.prototype = {
      hmac.init(hmac.SHA1,
                keyFactory.keyFromString(Ci.nsIKeyObject.HMAC, signatureKey));
      // No UTF-8 encoding, special chars are already escaped.
@@ -880,7 +597,7 @@ index fac9c56..af5e4d5 100644
      hmac.update(bytes, bytes.length);
      let signature = hmac.finish(true);
  
-@@ -555,6 +554,11 @@ Account.prototype = {
+@@ -578,6 +646,17 @@ Account.prototype = {
      let url = "1.1/statuses/destroy/" + aTweet.id_str + ".json";
      this.signAndSend(url, null, [], aOnSent, aOnError, aThis);
    },
@@ -889,10 +606,16 @@ index fac9c56..af5e4d5 100644
 +    this.signAndSend("1.1/direct_messages/new.json", null, POSTData, aOnSent,
 +                     aOnError, aThis);
 +  },
++  like: function(aTweet, aRemoveLike, aOnSent, aOnError, aThis) {
++    const action = aRemoveLike ? "destroy" : "create";
++    const url = `1.1/favorites/${action}.json`;
++    const POSTData = [["id", aTweet.id_str]];
++    this.signAndSend(url, null, POSTData, aOnSent, aOnError, aThis);
++  },
  
    _friends: null,
    follow: function(aUserName) {
-@@ -617,29 +621,7 @@ Account.prototype = {
+@@ -640,29 +719,7 @@ Account.prototype = {
      }
    },
  
@@ -923,7 +646,7 @@ index fac9c56..af5e4d5 100644
  
    onTimelineError: function(aError, aResponseText, aRequest) {
      this.ERROR(aError);
-@@ -687,7 +669,7 @@ Account.prototype = {
+@@ -710,7 +767,7 @@ Account.prototype = {
  
      this._timelineBuffer.sort(this.sortByDate);
      this._timelineBuffer.forEach(aTweet => aTweet.delayed = true);
@@ -932,8 +655,8 @@ index fac9c56..af5e4d5 100644
  
      // Fetch userInfo for the user if we don't already have it.
      this.requestBuddyInfo(this.name);
-@@ -739,7 +721,7 @@ Account.prototype = {
-     this.DEBUG("Received data: " + newText);
+@@ -765,7 +822,7 @@ Account.prototype = {
+       this.DEBUG("Received ping");
      let messages = newText.split(/\r\n?/);
      this._pendingData = messages.pop();
 -    for each (let message in messages) {
@@ -941,7 +664,7 @@ index fac9c56..af5e4d5 100644
        if (!message.trim())
          continue;
        let msg;
-@@ -749,13 +731,18 @@ Account.prototype = {
+@@ -775,13 +832,18 @@ Account.prototype = {
          this.ERROR(e + " while parsing " + message);
          continue;
        }
@@ -963,7 +686,21 @@ index fac9c56..af5e4d5 100644
            userInfoIds.add(userInfo.id_str);
          let ids = msg.friends.filter(
            aId => !userInfoIds.has(aId.toString()));
-@@ -951,7 +938,7 @@ Account.prototype = {
+@@ -913,10 +975,11 @@ Account.prototype = {
+   finishAuthorizationRequest: function() {
+     // Clean up the cookies, so that several twitter OAuth dialogs can work
+     // during the same session (bug 954308).
+-    let cookies = Services.cookies.getCookiesFromHost("twitter.com");
++    let cookies = Services.cookies.getCookiesFromHost("twitter.com", {});
+     while (cookies.hasMoreElements()) {
+       let cookie = cookies.getNext().QueryInterface(Ci.nsICookie2);
+-      Services.cookies.remove(cookie.host, cookie.name, cookie.path, false);
++      Services.cookies.remove(cookie.host, cookie.name, cookie.path, false,
++                              cookie.originAttributes);
+     }
+ 
+     if (!("_browserRequest" in this))
+@@ -977,7 +1040,7 @@ Account.prototype = {
    cleanUp: function() {
      this.finishAuthorizationRequest();
      if (this._pendingRequests.length != 0) {
@@ -972,7 +709,7 @@ index fac9c56..af5e4d5 100644
          request.abort();
        delete this._pendingRequests;
      }
-@@ -1088,7 +1075,7 @@ Account.prototype = {
+@@ -1114,7 +1177,7 @@ Account.prototype = {
    // create the participant.
    onLookupReceived: function(aData) {
      let users = JSON.parse(aData);
@@ -981,7 +718,7 @@ index fac9c56..af5e4d5 100644
        this.setUserInfo(user);
        this.timeline._ensureParticipantExists(user.screen_name);
      }
-@@ -1103,6 +1090,19 @@ Account.prototype = {
+@@ -1129,6 +1192,19 @@ Account.prototype = {
    joinChat: function(aComponents) {
      // The 'timeline' getter opens a timeline conversation if none exists.
      this.timeline;
diff --git a/projects/instantbird/0006-Bug-1218193-Fix-tab-strip-background-colour-on-OS-X..patch b/projects/instantbird/0006-Bug-1218193-Fix-tab-strip-background-colour-on-OS-X..patch
index 0560882..6350a49 100644
--- a/projects/instantbird/0006-Bug-1218193-Fix-tab-strip-background-colour-on-OS-X..patch
+++ b/projects/instantbird/0006-Bug-1218193-Fix-tab-strip-background-colour-on-OS-X..patch
@@ -1,4 +1,4 @@
-From 1097f15ec6c55c3ebc6520f52ecb01e9fc7bc175 Mon Sep 17 00:00:00 2001
+From d9a7eb05a9c292f8e9be864e6d77da581c1371b2 Mon Sep 17 00:00:00 2001
 From: Nihanth Subramanya <nhnt11 at gmail.com>
 Date: Sun, 9 Oct 2016 21:53:04 -0700
 Subject: [PATCH 06/25] Bug 1218193 - Fix tab strip background colour on OS X.
diff --git a/projects/instantbird/0007-Bug-1246431-XMPP-createConversation-should-handle-in.patch b/projects/instantbird/0007-Bug-1246431-XMPP-createConversation-should-handle-in.patch
index c6684d2..c18cca0 100644
--- a/projects/instantbird/0007-Bug-1246431-XMPP-createConversation-should-handle-in.patch
+++ b/projects/instantbird/0007-Bug-1246431-XMPP-createConversation-should-handle-in.patch
@@ -1,4 +1,4 @@
-From a4acaa0c5b4963ae8ae9af89f8904ae8b52ff751 Mon Sep 17 00:00:00 2001
+From 21254cac1e256e3468bfec270ad5898b33066a8b Mon Sep 17 00:00:00 2001
 From: Arlo Breault <arlolra at gmail.com>
 Date: Sun, 9 Oct 2016 21:57:07 -0700
 Subject: [PATCH 07/25] Bug 1246431 - XMPP createConversation should handle
diff --git a/projects/instantbird/0008-Bug-1298574-Set-_userVCard-own-property-when-downloa.patch b/projects/instantbird/0008-Bug-1298574-Set-_userVCard-own-property-when-downloa.patch
index a51ca7d..29f4833 100644
--- a/projects/instantbird/0008-Bug-1298574-Set-_userVCard-own-property-when-downloa.patch
+++ b/projects/instantbird/0008-Bug-1298574-Set-_userVCard-own-property-when-downloa.patch
@@ -1,4 +1,4 @@
-From 6f0ccf88c312363cf66746a2d18b8a2c2e6d024a Mon Sep 17 00:00:00 2001
+From c5d6eb544b71fb444fdf3b9b36965ed9a48070e8 Mon Sep 17 00:00:00 2001
 From: Arlo Breault <arlolra at gmail.com>
 Date: Sun, 28 Aug 2016 08:57:41 -0700
 Subject: [PATCH 08/25] Bug 1298574 - Set _userVCard own property when
diff --git a/projects/instantbird/0009-XMPP-in-band-registration.patch b/projects/instantbird/0009-XMPP-in-band-registration.patch
index bf41fe8..d68aa7d 100644
--- a/projects/instantbird/0009-XMPP-in-band-registration.patch
+++ b/projects/instantbird/0009-XMPP-in-band-registration.patch
@@ -1,4 +1,4 @@
-From 4b2c84d1cb9c80f4d957f51ca65ad196a08d67cb Mon Sep 17 00:00:00 2001
+From ed0b86bfdda083aaf7ecd7cbcf824d3874c1e332 Mon Sep 17 00:00:00 2001
 From: Sukhbir Singh <sukhbir at torproject.org>
 Date: Mon, 10 Oct 2016 18:42:25 -0700
 Subject: [PATCH 09/25] XMPP in-band registration
diff --git a/projects/instantbird/0010-Remove-search-from-UI.patch b/projects/instantbird/0010-Remove-search-from-UI.patch
index b7081b5..3a8208b 100644
--- a/projects/instantbird/0010-Remove-search-from-UI.patch
+++ b/projects/instantbird/0010-Remove-search-from-UI.patch
@@ -1,4 +1,4 @@
-From df3b932067fe85d6846629f284d67100da8cca95 Mon Sep 17 00:00:00 2001
+From bde276da0f20ebf4815a9b0b2a5c7152d067b019 Mon Sep 17 00:00:00 2001
 From: Sukhbir Singh <sukhbir at torproject.org>
 Date: Mon, 10 Oct 2016 18:47:48 -0700
 Subject: [PATCH 10/25] Remove search from UI
diff --git a/projects/instantbird/0011-Add-Tor-Messenger-branding.patch b/projects/instantbird/0011-Add-Tor-Messenger-branding.patch
index 816d118..537ae08 100644
--- a/projects/instantbird/0011-Add-Tor-Messenger-branding.patch
+++ b/projects/instantbird/0011-Add-Tor-Messenger-branding.patch
@@ -1,4 +1,4 @@
-From fc8bed18df09395214de807f451867d0644e76d9 Mon Sep 17 00:00:00 2001
+From 506c39b4736f8c983aa47303d7b2487dbf7e57c9 Mon Sep 17 00:00:00 2001
 From: Sukhbir Singh <sukhbir at torproject.org>
 Date: Mon, 10 Oct 2016 18:56:27 -0700
 Subject: [PATCH 11/25] Add Tor Messenger branding
diff --git a/projects/instantbird/0012-Account-picture.patch b/projects/instantbird/0012-Account-picture.patch
index 263b7b4..a563ce0 100644
--- a/projects/instantbird/0012-Account-picture.patch
+++ b/projects/instantbird/0012-Account-picture.patch
@@ -1,4 +1,4 @@
-From 18612ed548d0f61821fdf5cfd7473603c686abe8 Mon Sep 17 00:00:00 2001
+From 2ce648e15ef32419459567cf44d928f09ff9f562 Mon Sep 17 00:00:00 2001
 From: Sukhbir Singh <sukhbir at torproject.org>
 Date: Mon, 10 Oct 2016 19:24:09 -0700
 Subject: [PATCH 12/25] Account picture
diff --git a/projects/instantbird/0013-Modify-protocol-defaults.patch b/projects/instantbird/0013-Modify-protocol-defaults.patch
index d2f65ff..57218e3 100644
--- a/projects/instantbird/0013-Modify-protocol-defaults.patch
+++ b/projects/instantbird/0013-Modify-protocol-defaults.patch
@@ -1,4 +1,4 @@
-From a27b08e0f0db7d46161dd3809adfd470212dff6f Mon Sep 17 00:00:00 2001
+From 57702ae527cd5b214f797731e9a1c7653096cb43 Mon Sep 17 00:00:00 2001
 From: Sukhbir Singh <sukhbir at torproject.org>
 Date: Mon, 10 Oct 2016 19:25:34 -0700
 Subject: [PATCH 13/25] Modify protocol defaults
diff --git a/projects/instantbird/0014-Modify-IRC-defaults.patch b/projects/instantbird/0014-Modify-IRC-defaults.patch
index 283b887..58860e9 100644
--- a/projects/instantbird/0014-Modify-IRC-defaults.patch
+++ b/projects/instantbird/0014-Modify-IRC-defaults.patch
@@ -1,4 +1,4 @@
-From 4dae231482e2b422261e81e807aa64f28190d783 Mon Sep 17 00:00:00 2001
+From 6de7f7d3d973a6bea2a35462720e30f76c5e3d1c Mon Sep 17 00:00:00 2001
 From: Sukhbir Singh <sukhbir at torproject.org>
 Date: Mon, 10 Oct 2016 19:31:58 -0700
 Subject: [PATCH 14/25] Modify IRC defaults
diff --git a/projects/instantbird/0015-Modify-themes.patch b/projects/instantbird/0015-Modify-themes.patch
index f153abe..d6f2472 100644
--- a/projects/instantbird/0015-Modify-themes.patch
+++ b/projects/instantbird/0015-Modify-themes.patch
@@ -1,4 +1,4 @@
-From 742febffe131fcc893002f16e9e030911a66571c Mon Sep 17 00:00:00 2001
+From 20f2987874fc704cb3ce5f342ab911538620ac68 Mon Sep 17 00:00:00 2001
 From: Sukhbir Singh <sukhbir at torproject.org>
 Date: Mon, 10 Oct 2016 19:36:38 -0700
 Subject: [PATCH 15/25] Modify themes
diff --git a/projects/instantbird/0016-Modify-XMPP-defaults.patch b/projects/instantbird/0016-Modify-XMPP-defaults.patch
index 1f64cfc..aad94d2 100644
--- a/projects/instantbird/0016-Modify-XMPP-defaults.patch
+++ b/projects/instantbird/0016-Modify-XMPP-defaults.patch
@@ -1,4 +1,4 @@
-From 41ff53a3acd5820e068b18ebc002e0166603614e Mon Sep 17 00:00:00 2001
+From c326a8f3519d31ec6c1a2434a0ead4fa30d7aab0 Mon Sep 17 00:00:00 2001
 From: Sukhbir Singh <sukhbir at torproject.org>
 Date: Mon, 10 Oct 2016 19:38:49 -0700
 Subject: [PATCH 16/25] Modify XMPP defaults
diff --git a/projects/instantbird/0017-Remove-logging-UI.patch b/projects/instantbird/0017-Remove-logging-UI.patch
index 0d27ff4..df865b8 100644
--- a/projects/instantbird/0017-Remove-logging-UI.patch
+++ b/projects/instantbird/0017-Remove-logging-UI.patch
@@ -1,4 +1,4 @@
-From 8dce79fd121a235eb76cf6b1c89602df71c0444a Mon Sep 17 00:00:00 2001
+From 3270c324549b70ae92a09b3c28ba84bfd65c61e0 Mon Sep 17 00:00:00 2001
 From: Sukhbir Singh <sukhbir at torproject.org>
 Date: Mon, 10 Oct 2016 19:50:48 -0700
 Subject: [PATCH 17/25] Remove logging UI
diff --git a/projects/instantbird/0018-Cert-override.patch b/projects/instantbird/0018-Cert-override.patch
index 145e8b1..2c7d611 100644
--- a/projects/instantbird/0018-Cert-override.patch
+++ b/projects/instantbird/0018-Cert-override.patch
@@ -1,4 +1,4 @@
-From 00092f660dc41ce113c8562d265e0403cc63ea53 Mon Sep 17 00:00:00 2001
+From ccf46a070de2d8bdf3edabbebd42bb8c5e55388f Mon Sep 17 00:00:00 2001
 From: Sukhbir Singh <sukhbir at torproject.org>
 Date: Mon, 10 Oct 2016 19:56:46 -0700
 Subject: [PATCH 18/25] Cert override
diff --git a/projects/instantbird/0019-Display-all-traffic-over-Tor.patch b/projects/instantbird/0019-Display-all-traffic-over-Tor.patch
index ef67175..dfebfc0 100644
--- a/projects/instantbird/0019-Display-all-traffic-over-Tor.patch
+++ b/projects/instantbird/0019-Display-all-traffic-over-Tor.patch
@@ -1,4 +1,4 @@
-From 37c4e97814cdfffeca5032166c11e67d67ed2575 Mon Sep 17 00:00:00 2001
+From 86bdc8f65a2a8cc75c0b58b64f0edf3a98f1a5fd Mon Sep 17 00:00:00 2001
 From: Sukhbir Singh <sukhbir at torproject.org>
 Date: Mon, 10 Oct 2016 19:58:31 -0700
 Subject: [PATCH 19/25] Display all traffic over Tor
diff --git a/projects/instantbird/0020-Trac-17480-Content-sink.patch b/projects/instantbird/0020-Trac-17480-Content-sink.patch
index 5c5cb44..488776c 100644
--- a/projects/instantbird/0020-Trac-17480-Content-sink.patch
+++ b/projects/instantbird/0020-Trac-17480-Content-sink.patch
@@ -1,15 +1,15 @@
-From 2ad3442b1e51692dd0e5f7cc73f6d941a6cb5056 Mon Sep 17 00:00:00 2001
+From d8136d469553e45875c549cb94d9d6796f577968 Mon Sep 17 00:00:00 2001
 From: Arlo Breault <arlolra at gmail.com>
 Date: Wed, 5 Oct 2016 11:09:25 -0700
 Subject: [PATCH 20/25] Trac 17480: Content sink
 
 ---
- chat/modules/imContentSink.jsm     | 32 ++++++--------------------------
+ chat/modules/imContentSink.jsm     | 33 ++++++---------------------------
  im/content/preferences/content.xul |  2 +-
- 2 files changed, 7 insertions(+), 27 deletions(-)
+ 2 files changed, 7 insertions(+), 28 deletions(-)
 
 diff --git a/chat/modules/imContentSink.jsm b/chat/modules/imContentSink.jsm
-index ee067af..9f42607 100644
+index abd95fc..fa32442 100644
 --- a/chat/modules/imContentSink.jsm
 +++ b/chat/modules/imContentSink.jsm
 @@ -42,7 +42,7 @@ this.EXPORTED_SYMBOLS = [
@@ -21,18 +21,19 @@ index ee067af..9f42607 100644
  var kAllowedMozClasses =
    aClassName => aClassName == "moz-txt-underscore" ||
                  aClassName == "moz-txt-tag" ||
-@@ -59,10 +59,6 @@ var kStrictMode = {
+@@ -60,11 +60,6 @@ var kStrictMode = {
    attrs: { },
  
    tags: {
 -    'a': {
 -      'title': true,
--      'href': kAllowedURLs
+-      'href': kAllowedURLs,
+-      'class': kAllowedAnchorClasses
 -    },
      'br': true,
      'p': true
    },
-@@ -72,12 +68,9 @@ var kStrictMode = {
+@@ -74,12 +69,9 @@ var kStrictMode = {
  
  // standard mode allows basic formattings (bold, italic, underlined)
  var kStandardMode = {
@@ -45,8 +46,8 @@ index ee067af..9f42607 100644
 -    'div': true,
      'a': {
        'title': true,
-       'href': kAllowedURLs
-@@ -87,24 +80,11 @@ var kStandardMode = {
+       'href': kAllowedURLs,
+@@ -90,24 +82,11 @@ var kStandardMode = {
      'b': true,
      'i': true,
      'u': true,
@@ -72,7 +73,7 @@ index ee067af..9f42607 100644
  };
  
  // permissive mode allows about anything that isn't going to mess up the chat window
-@@ -158,7 +138,7 @@ var kPermissiveMode = {
+@@ -162,7 +141,7 @@ var kPermissiveMode = {
  };
  
  var kModePref = "messenger.options.filterMode";
@@ -81,7 +82,7 @@ index ee067af..9f42607 100644
  
  var gGlobalRuleset = null;
  
-@@ -184,8 +164,8 @@ var styleObserver = {
+@@ -188,8 +167,8 @@ var styleObserver = {
  function getModePref()
  {
    let baseNum = Services.prefs.getIntPref(kModePref);
diff --git a/projects/instantbird/0021-SASL-ECDSA-NIST256P-CHALLENGE.patch b/projects/instantbird/0021-SASL-ECDSA-NIST256P-CHALLENGE.patch
index ba7c48d..7629d5b 100644
--- a/projects/instantbird/0021-SASL-ECDSA-NIST256P-CHALLENGE.patch
+++ b/projects/instantbird/0021-SASL-ECDSA-NIST256P-CHALLENGE.patch
@@ -1,4 +1,4 @@
-From 5da8b2b083e0bb69c45ed2b4e116118afaaf903e Mon Sep 17 00:00:00 2001
+From 2924c20a36d541422d95f05cfa5b078526363fae Mon Sep 17 00:00:00 2001
 From: Arlo Breault <arlolra at gmail.com>
 Date: Sun, 2 Oct 2016 08:46:55 -0700
 Subject: [PATCH 21/25] SASL ECDSA-NIST256P-CHALLENGE
diff --git a/projects/instantbird/0022-Bug-1313137-msg-is-not-defined-error-in-irc.js-chang.patch b/projects/instantbird/0022-Bug-1313137-msg-is-not-defined-error-in-irc.js-chang.patch
index 1ff4bdf..8d181d1 100644
--- a/projects/instantbird/0022-Bug-1313137-msg-is-not-defined-error-in-irc.js-chang.patch
+++ b/projects/instantbird/0022-Bug-1313137-msg-is-not-defined-error-in-irc.js-chang.patch
@@ -1,4 +1,4 @@
-From c6c72edf0db68cfe560a7f7258ba73a20ffd140f Mon Sep 17 00:00:00 2001
+From 7e4e89fd1a5a14bf2b4afdc32a83e08f759244b9 Mon Sep 17 00:00:00 2001
 From: aleth <aleth at instantbird.org>
 Date: Wed, 26 Oct 2016 20:16:58 +0200
 Subject: [PATCH 22/25] Bug 1313137 - "msg is not defined" error in
diff --git a/projects/instantbird/0023-Bug-954368-Contact-list-entries-should-adapt-their-h.patch b/projects/instantbird/0023-Bug-954368-Contact-list-entries-should-adapt-their-h.patch
index e8de6fa..c3335f0 100644
--- a/projects/instantbird/0023-Bug-954368-Contact-list-entries-should-adapt-their-h.patch
+++ b/projects/instantbird/0023-Bug-954368-Contact-list-entries-should-adapt-their-h.patch
@@ -1,4 +1,4 @@
-From 90963a7e9711b4b14b6ddb977691d16f4744978c Mon Sep 17 00:00:00 2001
+From 0dc553e078f0d6f7c493baac6757b17bb6bf613b Mon Sep 17 00:00:00 2001
 From: aleth <aleth at instantbird.org>
 Date: Thu, 12 May 2016 15:10:43 +0200
 Subject: [PATCH 23/25] Bug 954368 - Contact list entries should adapt their
diff --git a/projects/instantbird/0024-Bug-1187281-Only-show-close-button-on-Windows.patch b/projects/instantbird/0024-Bug-1187281-Only-show-close-button-on-Windows.patch
index 754a963..e176a3e 100644
--- a/projects/instantbird/0024-Bug-1187281-Only-show-close-button-on-Windows.patch
+++ b/projects/instantbird/0024-Bug-1187281-Only-show-close-button-on-Windows.patch
@@ -1,4 +1,4 @@
-From 12a4289e7eaf033b6a2921c656ed28b923d45481 Mon Sep 17 00:00:00 2001
+From 995d262e94b51a893c40bcb20c7f92dbcb68bad7 Mon Sep 17 00:00:00 2001
 From: Arlo Breault <arlolra at gmail.com>
 Date: Sat, 5 Nov 2016 14:55:20 -0700
 Subject: [PATCH 24/25] Bug 1187281 - Only show "close" button on Windows
diff --git a/projects/instantbird/0025-Bug-1316000-Remove-old-Yahoo-Messenger-support.-r-al.patch b/projects/instantbird/0025-Bug-1316000-Remove-old-Yahoo-Messenger-support.-r-al.patch
index 929d912..26d7f65 100644
--- a/projects/instantbird/0025-Bug-1316000-Remove-old-Yahoo-Messenger-support.-r-al.patch
+++ b/projects/instantbird/0025-Bug-1316000-Remove-old-Yahoo-Messenger-support.-r-al.patch
@@ -1,4 +1,4 @@
-From cf2f98bae6a4140fe24fbbe170a82323fc12314e Mon Sep 17 00:00:00 2001
+From d63bca2d8110c2f0db343cee17e81ea6f5943020 Mon Sep 17 00:00:00 2001
 From: Patrick Cloke <clokep at gmail.com>
 Date: Wed, 9 Nov 2016 09:03:49 -0800
 Subject: [PATCH 25/25] Bug 1316000 - Remove old Yahoo! Messenger support.
diff --git a/projects/mozilla/0001-Trac-19910-Prevents-STARTTLS-in-XMPP.patch b/projects/mozilla/0001-Trac-19910-Prevents-STARTTLS-in-XMPP.patch
index f365561..93e415b 100644
--- a/projects/mozilla/0001-Trac-19910-Prevents-STARTTLS-in-XMPP.patch
+++ b/projects/mozilla/0001-Trac-19910-Prevents-STARTTLS-in-XMPP.patch
@@ -1,4 +1,4 @@
-From 428362e2eee5c06ec84c6d52ff0327d1cbb8beda Mon Sep 17 00:00:00 2001
+From bd289165bfce9d0239d67571755cee1048e9433b Mon Sep 17 00:00:00 2001
 From: Arlo Breault <arlolra at gmail.com>
 Date: Mon, 10 Oct 2016 10:52:52 -0700
 Subject: [PATCH 1/6] Trac 19910: Prevents STARTTLS in XMPP
diff --git a/projects/mozilla/0002-Trac-16475-Block-flash-too.patch b/projects/mozilla/0002-Trac-16475-Block-flash-too.patch
index 19481d3..10f6209 100644
--- a/projects/mozilla/0002-Trac-16475-Block-flash-too.patch
+++ b/projects/mozilla/0002-Trac-16475-Block-flash-too.patch
@@ -1,4 +1,4 @@
-From 05842dca95a626ccdad123be15353b00ff03a7f0 Mon Sep 17 00:00:00 2001
+From a37fd7380b807ff8e4cebaef8a5817c670816091 Mon Sep 17 00:00:00 2001
 From: Arlo Breault <arlolra at gmail.com>
 Date: Thu, 6 Oct 2016 20:13:35 -0700
 Subject: [PATCH 2/6] Trac 16475: Block flash too
diff --git a/projects/mozilla/0003-Trac-20206-Avoid-the-need-to-download-the-font-Osaka.patch b/projects/mozilla/0003-Trac-20206-Avoid-the-need-to-download-the-font-Osaka.patch
index 4cd9013..e0eb945 100644
--- a/projects/mozilla/0003-Trac-20206-Avoid-the-need-to-download-the-font-Osaka.patch
+++ b/projects/mozilla/0003-Trac-20206-Avoid-the-need-to-download-the-font-Osaka.patch
@@ -1,4 +1,4 @@
-From 401acfb1085f0ac9de8628a4f87d522fccbae8b1 Mon Sep 17 00:00:00 2001
+From 39f09114b425a248516f27296a57b91978d47b81 Mon Sep 17 00:00:00 2001
 From: Jonathan Kew <jkew at mozilla.com>
 Date: Sun, 9 Oct 2016 09:18:37 -0700
 Subject: [PATCH 3/6] Trac 20206: Avoid the need to download the font Osaka
diff --git a/projects/mozilla/0004-Trac-18331-Update-OS-X-toolchain-to-work-with-ESR-45.patch b/projects/mozilla/0004-Trac-18331-Update-OS-X-toolchain-to-work-with-ESR-45.patch
index 0331884..6598c3a 100644
--- a/projects/mozilla/0004-Trac-18331-Update-OS-X-toolchain-to-work-with-ESR-45.patch
+++ b/projects/mozilla/0004-Trac-18331-Update-OS-X-toolchain-to-work-with-ESR-45.patch
@@ -1,4 +1,4 @@
-From 283d30517d1795fff99c0c193eeabe06043b591b Mon Sep 17 00:00:00 2001
+From 074aeb6d15c5098991d0d7e652eddbf3b72f91d7 Mon Sep 17 00:00:00 2001
 From: Arlo Breault <arlolra at gmail.com>
 Date: Wed, 23 Mar 2016 19:52:07 -0700
 Subject: [PATCH 4/6] Trac 18331: Update OS X toolchain to work with ESR 45
diff --git a/projects/mozilla/0005-OSX-package-as-tar.bz2.patch b/projects/mozilla/0005-OSX-package-as-tar.bz2.patch
index 18652a0..5272b75 100644
--- a/projects/mozilla/0005-OSX-package-as-tar.bz2.patch
+++ b/projects/mozilla/0005-OSX-package-as-tar.bz2.patch
@@ -1,4 +1,4 @@
-From 386cca851618f0d19f7ce07483c0b290e178ce46 Mon Sep 17 00:00:00 2001
+From a758107c5d793f0bfb686a5b60c70037b8ebf1bb Mon Sep 17 00:00:00 2001
 From: Nicolas Vigier <boklm at torproject.org>
 Date: Thu, 25 Jun 2015 12:18:43 +0200
 Subject: [PATCH 5/6] OSX: package as tar.bz2
diff --git a/projects/mozilla/0006-Updater-fixups-for-TM.patch b/projects/mozilla/0006-Updater-fixups-for-TM.patch
index 0dd6a00..fd54e53 100644
--- a/projects/mozilla/0006-Updater-fixups-for-TM.patch
+++ b/projects/mozilla/0006-Updater-fixups-for-TM.patch
@@ -1,4 +1,4 @@
-From 8f449e5b031577a45b80a58c798ad89bcf1ce2a6 Mon Sep 17 00:00:00 2001
+From 63d8e00c912bdbe1c336ecf4276e123d59c41be3 Mon Sep 17 00:00:00 2001
 From: Arlo Breault <arlolra at gmail.com>
 Date: Sun, 9 Oct 2016 09:34:38 -0700
 Subject: [PATCH 6/6] Updater fixups for TM
diff --git a/projects/mozilla/config b/projects/mozilla/config
index 1c224be..ec93ff5 100644
--- a/projects/mozilla/config
+++ b/projects/mozilla/config
@@ -1,8 +1,10 @@
 # vim: filetype=yaml sw=2
-version: '[% c("abbrev") %]'
+version: tor-browser-45.5.1esr-6.0-1-build1
 filename: 'mozilla-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
 git_url: https://git.torproject.org/tor-browser.git
-git_hash: f0382d95b8145b91bae099024bce64affff34523
+git_hash: '[% c("version") %]'
+gpg_keyring: gk.gpg
+tag_gpg_id: 1
 input_files:
   - filename: 0001-Trac-19910-Prevents-STARTTLS-in-XMPP.patch
   - filename: 0002-Trac-16475-Block-flash-too.patch
diff --git a/projects/tor-browser/config b/projects/tor-browser/config
index 34a2402..b1e035f 100644
--- a/projects/tor-browser/config
+++ b/projects/tor-browser/config
@@ -1,5 +1,5 @@
 # vim: filetype=yaml sw=2
-version: 6.0.6
+version: 6.0.7
 filename: 'tor-browser-[% c("version") %]-[% c("var/osname") %].[% c("var/extension") %]'
 
 input_files:



More information about the tor-commits mailing list