Respect follower emotes context, making them only available in their owner channels (#2951)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Paweł
2021-07-11 11:12:49 +02:00
committed by GitHub
parent 2844c8e7e0
commit d5add46730
14 changed files with 180 additions and 28 deletions
+14 -2
View File
@@ -80,8 +80,20 @@ void InputCompletionPopup::updateEmotes(const QString &text, ChannelPtr channel)
{
if (auto user = getApp()->accounts->twitch.getCurrent())
{
auto twitch = user->accessEmotes();
addEmotes(emotes, twitch->emotes, text, "Twitch Emote");
// Twitch Emotes available globally
auto emoteData = user->accessEmotes();
addEmotes(emotes, emoteData->emotes, text, "Twitch Emote");
// Twitch Emotes available locally
auto localEmoteData = user->accessLocalEmotes();
if (localEmoteData->find(tc->roomId()) != localEmoteData->end())
{
if (auto localEmotes = &localEmoteData->at(tc->roomId()))
{
addEmotes(emotes, *localEmotes, text,
"Local Twitch Emotes");
}
}
}
if (tc)