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 i = int();
|
||||||
auto currentTwitchEmote = twitchEmotes.begin();
|
auto currentTwitchEmote = twitchEmotes.begin();
|
||||||
|
|
||||||
for (const auto &word : words)
|
for (auto word : words)
|
||||||
{
|
{
|
||||||
// check if it's a twitch emote twitch emote
|
// check if it's a twitch emote twitch emote
|
||||||
while (currentTwitchEmote != twitchEmotes.end() &&
|
while (currentTwitchEmote != twitchEmotes.end() &&
|
||||||
|
@ -376,9 +376,19 @@ void TwitchMessageBuilder::addWords(
|
||||||
MessageElementFlag::TwitchEmote);
|
MessageElementFlag::TwitchEmote);
|
||||||
|
|
||||||
i += word.length() + 1;
|
i += word.length() + 1;
|
||||||
|
|
||||||
|
int len = std::get<2>(*currentTwitchEmote).string.length();
|
||||||
currentTwitchEmote++;
|
currentTwitchEmote++;
|
||||||
|
|
||||||
continue;
|
if (len < word.length())
|
||||||
|
{
|
||||||
|
word = word.mid(len);
|
||||||
|
this->message().elements.back()->setTrailingSpace(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// split words
|
// split words
|
||||||
|
|
Loading…
Reference in a new issue