mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Fixes #409 hovering smilies shows the regex emote code
This commit is contained in:
parent
65846fe1c7
commit
935cd1bab0
1 changed files with 13 additions and 0 deletions
|
@ -541,6 +541,19 @@ util::EmoteData EmoteManager::getTwitchEmoteById(long id, const QString &emoteNa
|
||||||
QString _emoteName = emoteName;
|
QString _emoteName = emoteName;
|
||||||
_emoteName.replace("<", "<");
|
_emoteName.replace("<", "<");
|
||||||
|
|
||||||
|
static QMap<QString, QString> emoteNameReplacements{
|
||||||
|
{"[oO](_|\\.)[oO]", "o_O"}, {"\\>\\;\\(", ">("}, {"\\<\\;3", "<3"},
|
||||||
|
{"\\:-?(o|O)", ":O"}, {"\\:-?(p|P)", ":P"}, {"\\:-?[\\\\/]", ":/"},
|
||||||
|
{"\\:-?[z|Z|\\|]", ":z"}, {"\\:-?\\(", ":("}, {"\\:-?\\)", ":)"},
|
||||||
|
{"\\:-?D", ":D"}, {"\\;-?(p|P)", ";P"}, {"\\;-?\\)", ";)"},
|
||||||
|
{"R-?\\)", "R-)"},
|
||||||
|
};
|
||||||
|
|
||||||
|
auto it = emoteNameReplacements.find(_emoteName);
|
||||||
|
if (it != emoteNameReplacements.end()) {
|
||||||
|
_emoteName = it.value();
|
||||||
|
}
|
||||||
|
|
||||||
return _twitchEmoteFromCache.getOrAdd(id, [&emoteName, &_emoteName, &id] {
|
return _twitchEmoteFromCache.getOrAdd(id, [&emoteName, &_emoteName, &id] {
|
||||||
util::EmoteData newEmoteData;
|
util::EmoteData newEmoteData;
|
||||||
newEmoteData.image1x = new Image(GetTwitchEmoteLink(id, "1.0"), 1, emoteName,
|
newEmoteData.image1x = new Image(GetTwitchEmoteLink(id, "1.0"), 1, emoteName,
|
||||||
|
|
Loading…
Reference in a new issue