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:
@@ -69,6 +69,12 @@ namespace {
|
||||
|
||||
for (const auto &set : sets)
|
||||
{
|
||||
// Some emotes (e.g. follower ones) are only available in their origin channel
|
||||
if (set->local && currentChannelName != set->channelName)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// TITLE
|
||||
auto channelName = set->channelName;
|
||||
auto text = set->text.isEmpty() ? "Twitch" : set->text;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user