fix: Fix searching in emote popup if not in a twitch channel (#6357)

Co-authored-by: ScrubN <72096833+ScrubN@users.noreply.github.com>
This commit is contained in:
Vincent
2025-07-26 05:48:32 -04:00
committed by GitHub
parent 971c380681
commit 32c927d084
2 changed files with 26 additions and 33 deletions
+25 -33
View File
@@ -422,11 +422,6 @@ void EmotePopup::loadChannel(ChannelPtr channel)
this->setWindowTitle("Emotes in #" + this->channel_->getName());
if (this->twitchChannel_ == nullptr)
{
return;
}
this->globalEmotesView_->setChannel(
std::make_shared<Channel>("", Channel::Type::None));
this->subEmotesView_->setChannel(
@@ -441,11 +436,6 @@ void EmotePopup::loadChannel(ChannelPtr channel)
void EmotePopup::reloadEmotes()
{
if (this->twitchChannel_ == nullptr)
{
return;
}
auto subChannel = this->subEmotesView_->underlyingChannel();
auto globalChannel = this->globalEmotesView_->underlyingChannel();
auto channelChannel = this->channelEmotesView_->underlyingChannel();
@@ -454,13 +444,32 @@ void EmotePopup::reloadEmotes()
globalChannel->clearMessages();
channelChannel->clearMessages();
// twitch
addTwitchEmoteSets(
twitchChannel_->localTwitchEmotes(),
*getApp()->getAccounts()->twitch.getCurrent()->accessEmoteSets(),
*globalChannel, *subChannel, twitchChannel_->roomId(),
twitchChannel_->getName());
if (this->twitchChannel_)
{
// twitch
addTwitchEmoteSets(
twitchChannel_->localTwitchEmotes(),
*getApp()->getAccounts()->twitch.getCurrent()->accessEmoteSets(),
*globalChannel, *subChannel, twitchChannel_->roomId(),
twitchChannel_->getName());
// channel
if (Settings::instance().enableBTTVChannelEmotes)
{
addEmotes(*channelChannel, *this->twitchChannel_->bttvEmotes(),
"BetterTTV", MessageElementFlag::BttvEmote);
}
if (Settings::instance().enableFFZChannelEmotes)
{
addEmotes(*channelChannel, *this->twitchChannel_->ffzEmotes(),
"FrankerFaceZ", MessageElementFlag::FfzEmote);
}
if (Settings::instance().enableSevenTVChannelEmotes)
{
addEmotes(*channelChannel, *this->twitchChannel_->seventvEmotes(),
"7TV", MessageElementFlag::SevenTVEmote);
}
}
// global
if (Settings::instance().enableBTTVGlobalEmotes)
{
@@ -478,23 +487,6 @@ void EmotePopup::reloadEmotes()
"7TV", MessageElementFlag::SevenTVEmote);
}
// channel
if (Settings::instance().enableBTTVChannelEmotes)
{
addEmotes(*channelChannel, *this->twitchChannel_->bttvEmotes(),
"BetterTTV", MessageElementFlag::BttvEmote);
}
if (Settings::instance().enableFFZChannelEmotes)
{
addEmotes(*channelChannel, *this->twitchChannel_->ffzEmotes(),
"FrankerFaceZ", MessageElementFlag::FfzEmote);
}
if (Settings::instance().enableSevenTVChannelEmotes)
{
addEmotes(*channelChannel, *this->twitchChannel_->seventvEmotes(),
"7TV", MessageElementFlag::SevenTVEmote);
}
if (subChannel->getMessageSnapshot().size() == 0)
{
MessageBuilder builder;