feat: Add Live Emote Updates for BTTV (#4147)
This feature is enabled by default and can be disabled in settings with the "Enable BTTV live emotes updates" setting. Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com> Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -593,17 +593,37 @@ MessageBuilder::MessageBuilder(LiveUpdatesUpdateEmoteMessageTag /*unused*/,
|
||||
const QString &oldEmoteName)
|
||||
: MessageBuilder()
|
||||
{
|
||||
auto text = QString("renamed %1 emote %2 to %3.")
|
||||
.arg(platform, oldEmoteName, emoteName);
|
||||
QString text;
|
||||
if (actor.isEmpty())
|
||||
{
|
||||
text = "Renamed";
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "renamed";
|
||||
}
|
||||
text +=
|
||||
QString(" %1 emote %2 to %3.").arg(platform, oldEmoteName, emoteName);
|
||||
|
||||
this->emplace<TimestampElement>();
|
||||
this->emplace<TextElement>(actor, MessageElementFlag::Username,
|
||||
MessageColor::System)
|
||||
->setLink({Link::UserInfo, actor});
|
||||
if (!actor.isEmpty())
|
||||
{
|
||||
this->emplace<TextElement>(actor, MessageElementFlag::Username,
|
||||
MessageColor::System)
|
||||
->setLink({Link::UserInfo, actor});
|
||||
}
|
||||
this->emplace<TextElement>(text, MessageElementFlag::Text,
|
||||
MessageColor::System);
|
||||
|
||||
auto finalText = QString("%1 %2").arg(actor, text);
|
||||
QString finalText;
|
||||
if (actor.isEmpty())
|
||||
{
|
||||
finalText = text;
|
||||
}
|
||||
else
|
||||
{
|
||||
finalText = QString("%1 %2").arg(actor, text);
|
||||
}
|
||||
|
||||
this->message().loginName = actor;
|
||||
this->message().messageText = finalText;
|
||||
|
||||
Reference in New Issue
Block a user