mirror of https://github.com/calzoneman/sync.git
Fix and enable efficient emotes by default
This commit is contained in:
parent
cb6cfc8455
commit
dac2e41488
|
@ -2,7 +2,7 @@
|
||||||
"author": "Calvin Montgomery",
|
"author": "Calvin Montgomery",
|
||||||
"name": "CyTube",
|
"name": "CyTube",
|
||||||
"description": "Online media synchronizer and chat",
|
"description": "Online media synchronizer and chat",
|
||||||
"version": "3.44.1",
|
"version": "3.44.2",
|
||||||
"repository": {
|
"repository": {
|
||||||
"url": "http://github.com/calzoneman/sync"
|
"url": "http://github.com/calzoneman/sync"
|
||||||
},
|
},
|
||||||
|
|
|
@ -73,7 +73,7 @@ CyTube.ui = {
|
||||||
suppressedAnnouncementId: getOpt("suppressed_announcement_id")
|
suppressedAnnouncementId: getOpt("suppressed_announcement_id")
|
||||||
};
|
};
|
||||||
CyTube.featureFlag = {
|
CyTube.featureFlag = {
|
||||||
efficientEmotes: false
|
efficientEmotes: true
|
||||||
};
|
};
|
||||||
|
|
||||||
function getOpt(k) {
|
function getOpt(k) {
|
||||||
|
|
|
@ -2639,6 +2639,14 @@ function formatUserPlaylistList() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadEmotes(data) {
|
function loadEmotes(data) {
|
||||||
|
function sanitizeText(str) {
|
||||||
|
str = str.replace(/&/g, "&")
|
||||||
|
.replace(/</g, "<")
|
||||||
|
.replace(/>/g, ">")
|
||||||
|
.replace(/"/g, """);
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
CHANNEL.emotes = [];
|
CHANNEL.emotes = [];
|
||||||
CHANNEL.emoteMap = {};
|
CHANNEL.emoteMap = {};
|
||||||
CHANNEL.badEmotes = [];
|
CHANNEL.badEmotes = [];
|
||||||
|
@ -2650,7 +2658,7 @@ function loadEmotes(data) {
|
||||||
// Emotes with spaces can't be hashmapped
|
// Emotes with spaces can't be hashmapped
|
||||||
CHANNEL.badEmotes.push(e);
|
CHANNEL.badEmotes.push(e);
|
||||||
} else {
|
} else {
|
||||||
CHANNEL.emoteMap[e.name] = e;
|
CHANNEL.emoteMap[sanitizeText(e.name)] = e;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.error("Rejecting invalid emote: " + JSON.stringify(e));
|
console.error("Rejecting invalid emote: " + JSON.stringify(e));
|
||||||
|
|
Loading…
Reference in New Issue