From 3616027441e4e87593e94c7b22699d215cdf74eb Mon Sep 17 00:00:00 2001 From: SirStendec Date: Sun, 8 Dec 2019 16:09:37 -0500 Subject: [PATCH] 4.17.2 * Fixed: Normalize white-space when sending messages. This matches the behavior of Twitch's servers when normalizing chat messages and fixes client-side rendering issues with FrankerFaceZ. --- package.json | 2 +- src/experiments.json | 4 ++-- .../twitch-twilight/modules/chat/index.js | 22 +++++++++---------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index f67feed6..53b3424e 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.17.1", + "version": "4.17.2", "description": "FrankerFaceZ is a Twitch enhancement suite.", "license": "Apache-2.0", "scripts": { diff --git a/src/experiments.json b/src/experiments.json index 761d91b9..c65bfa4d 100644 --- a/src/experiments.json +++ b/src/experiments.json @@ -3,8 +3,8 @@ "name": "New API Stress Testing", "description": "Send duplicate requests to the new API server for load testing.", "groups": [ - {"value": true, "weight": 100}, - {"value": false, "weight": 0} + {"value": true, "weight": 50}, + {"value": false, "weight": 50} ] } } \ No newline at end of file diff --git a/src/sites/twitch-twilight/modules/chat/index.js b/src/sites/twitch-twilight/modules/chat/index.js index dc5705ae..81cb7c74 100644 --- a/src/sites/twitch-twilight/modules/chat/index.js +++ b/src/sites/twitch-twilight/modules/chat/index.js @@ -1468,7 +1468,7 @@ export default class ChatHook extends Module { cls.prototype._ffz_was_here = true; - cls.prototype.ffzGetEmotes = function() { + /*cls.prototype.ffzGetEmotes = function() { const emote_map = this.client && this.client.session && this.client.session.emoteMap; if ( this._ffz_cached_map === emote_map ) return this._ffz_cached_emotes; @@ -1489,7 +1489,7 @@ export default class ChatHook extends Module { } return emotes; - } + }*/ cls.prototype._ffzInstall = function() { @@ -1501,8 +1501,8 @@ export default class ChatHook extends Module { const inst = this, old_send = this.sendMessage; - inst.sendMessage = function(raw_msg) { - const msg = raw_msg.replace(/\n/g, ''); + inst.sendMessage = function(msg) { + msg = msg.replace(/\s+/g, ' '); if ( msg.startsWith('/ffz') ) { inst.addMessage({ @@ -1523,7 +1523,7 @@ export default class ChatHook extends Module { if ( event.defaultPrevented ) return; - return old_send.call(this, msg); + return old_send.call(this, event.message); } } @@ -1556,7 +1556,7 @@ export default class ChatHook extends Module { const old_chat = this.onChatMessageEvent; this.onChatMessageEvent = function(e) { - if ( e && e.sentByCurrentUser ) { + /*if ( e && e.sentByCurrentUser ) { try { e.message.user.emotes = findEmotes( e.message.body, @@ -1566,7 +1566,7 @@ export default class ChatHook extends Module { } catch(err) { t.log.capture(err, {extra: e}); } - } + }*/ return old_chat.call(i, e); } @@ -1574,7 +1574,7 @@ export default class ChatHook extends Module { const old_action = this.onChatActionEvent; this.onChatActionEvent = function(e) { - if ( e && e.sentByCurrentUser ) { + /*if ( e && e.sentByCurrentUser ) { try { e.message.user.emotes = findEmotes( e.message.body, @@ -1584,7 +1584,7 @@ export default class ChatHook extends Module { } catch(err) { t.log.capture(err, {extra: e}); } - } + }*/ return old_action.call(i, e); } @@ -2279,7 +2279,7 @@ export function formatBitsConfig(config) { } -export function findEmotes(msg, emotes) { +/*export function findEmotes(msg, emotes) { const out = {}; let idx = 0; @@ -2300,7 +2300,7 @@ export function findEmotes(msg, emotes) { } return out; -} +}*/ function extractCheerPrefix(parts) {