feat: Add 7TV Emotes and Badges (#4002)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix
2022-10-16 13:22:17 +02:00
committed by GitHub
parent e8fd49aadb
commit 3e41b84ed7
29 changed files with 780 additions and 7 deletions
+21
View File
@@ -359,6 +359,12 @@ void EmotePopup::loadChannel(ChannelPtr channel)
addEmotes(*globalChannel, *getApp()->twitch->getFfzEmotes().emotes(),
"FrankerFaceZ", MessageElementFlag::FfzEmote);
}
if (Settings::instance().enableSevenTVGlobalEmotes)
{
addEmotes(*globalChannel,
*getApp()->twitch->getSeventvEmotes().globalEmotes(), "7TV",
MessageElementFlag::SevenTVEmote);
}
// channel
if (Settings::instance().enableBTTVChannelEmotes)
@@ -371,6 +377,11 @@ void EmotePopup::loadChannel(ChannelPtr channel)
addEmotes(*channelChannel, *this->twitchChannel_->ffzEmotes(),
"FrankerFaceZ", MessageElementFlag::FfzEmote);
}
if (Settings::instance().enableSevenTVChannelEmotes)
{
addEmotes(*channelChannel, *this->twitchChannel_->seventvEmotes(),
"7TV", MessageElementFlag::SevenTVEmote);
}
this->globalEmotesView_->setChannel(globalChannel);
this->subEmotesView_->setChannel(subChannel);
@@ -429,6 +440,8 @@ void EmotePopup::filterTwitchEmotes(std::shared_ptr<Channel> searchChannel,
searchText, getApp()->twitch->getBttvEmotes().emotes());
auto ffzGlobalEmotes = this->filterEmoteMap(
searchText, getApp()->twitch->getFfzEmotes().emotes());
auto *seventvGlobalEmotes = this->filterEmoteMap(
searchText, getApp()->twitch->getSeventvEmotes().globalEmotes());
// twitch
addEmoteSets(twitchGlobalEmotes, *searchChannel, *searchChannel,
@@ -451,6 +464,9 @@ void EmotePopup::filterTwitchEmotes(std::shared_ptr<Channel> searchChannel,
this->filterEmoteMap(searchText, this->twitchChannel_->bttvEmotes());
auto ffzChannelEmotes =
this->filterEmoteMap(searchText, this->twitchChannel_->ffzEmotes());
auto *seventvChannelEmotes =
this->filterEmoteMap(searchText, this->twitchChannel_->seventvEmotes());
// channel
if (bttvChannelEmotes->size() > 0)
addEmotes(*searchChannel, *bttvChannelEmotes, "BetterTTV (Channel)",
@@ -458,6 +474,11 @@ void EmotePopup::filterTwitchEmotes(std::shared_ptr<Channel> searchChannel,
if (ffzChannelEmotes->size() > 0)
addEmotes(*searchChannel, *ffzChannelEmotes, "FrankerFaceZ (Channel)",
MessageElementFlag::FfzEmote);
if (!seventvChannelEmotes->empty())
{
addEmotes(*searchChannel, *seventvChannelEmotes, "SevenTV (Channel)",
MessageElementFlag::SevenTVEmote);
}
}
void EmotePopup::filterEmotes(const QString &searchText)