mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
fixes #1304 emote.name eating the .name
This commit is contained in:
parent
04f8875c4d
commit
84b1efcd24
|
@ -355,7 +355,7 @@ void TwitchMessageBuilder::addWords(
|
|||
auto i = int();
|
||||
auto currentTwitchEmote = twitchEmotes.begin();
|
||||
|
||||
for (const auto &word : words)
|
||||
for (auto word : words)
|
||||
{
|
||||
// check if it's a twitch emote twitch emote
|
||||
while (currentTwitchEmote != twitchEmotes.end() &&
|
||||
|
@ -376,10 +376,20 @@ void TwitchMessageBuilder::addWords(
|
|||
MessageElementFlag::TwitchEmote);
|
||||
|
||||
i += word.length() + 1;
|
||||
|
||||
int len = std::get<2>(*currentTwitchEmote).string.length();
|
||||
currentTwitchEmote++;
|
||||
|
||||
if (len < word.length())
|
||||
{
|
||||
word = word.mid(len);
|
||||
this->message().elements.back()->setTrailingSpace(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// split words
|
||||
for (auto &variant : getApp()->emotes->emojis.parse(word))
|
||||
|
|
Loading…
Reference in a new issue