diff --git a/src/providers/twitch/TwitchMessageBuilder.cpp b/src/providers/twitch/TwitchMessageBuilder.cpp index 98cca8476..ed9923215 100644 --- a/src/providers/twitch/TwitchMessageBuilder.cpp +++ b/src/providers/twitch/TwitchMessageBuilder.cpp @@ -958,49 +958,33 @@ void TwitchMessageBuilder::appendTwitchEmote( Outcome TwitchMessageBuilder::tryAppendEmote(const EmoteName &name) { - // Special channels, like /whispers and /channels return here - // This means they will not render any BTTV or FFZ emotes - if (this->twitchChannel == nullptr) - { - auto *app = getApp(); - const auto &bttvemotes = app->twitch.server->getBttvEmotes(); - const auto &ffzemotes = app->twitch.server->getFfzEmotes(); - auto flags = MessageElementFlags(); - auto emote = boost::optional<EmotePtr>{}; - { // bttv/ffz emote - if ((emote = bttvemotes.emote(name))) - { - flags = MessageElementFlag::BttvEmote; - } - else if ((emote = ffzemotes.emote(name))) - { - flags = MessageElementFlag::FfzEmote; - } - if (emote) - { - this->emplace<EmoteElement>(emote.get(), flags); - return Success; - } - } // bttv/ffz emote - return Failure; - } + auto *app = getApp(); + + const auto &globalBttvEmotes = app->twitch.server->getBttvEmotes(); + const auto &globalFfzEmotes = app->twitch.server->getFfzEmotes(); auto flags = MessageElementFlags(); auto emote = boost::optional<EmotePtr>{}; - if ((emote = this->twitchChannel->ffzEmote(name))) + // Emote order: + // - FrankerFaceZ Channel + // - BetterTTV Channel + // - FrankerFaceZ Global + // - BetterTTV Global + if (this->twitchChannel && (emote = this->twitchChannel->ffzEmote(name))) { flags = MessageElementFlag::FfzEmote; } - else if ((emote = this->twitchChannel->bttvEmote(name))) + else if (this->twitchChannel && + (emote = this->twitchChannel->bttvEmote(name))) { flags = MessageElementFlag::BttvEmote; } - else if ((emote = this->twitchChannel->globalFfz().emote(name))) + else if ((emote = globalFfzEmotes.emote(name))) { flags = MessageElementFlag::FfzEmote; } - else if ((emote = this->twitchChannel->globalBttv().emote(name))) + else if ((emote = globalBttvEmotes.emote(name))) { flags = MessageElementFlag::BttvEmote; }