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
+1
View File
@@ -49,6 +49,7 @@
- Bugfix: Fixed eventsub message delete notifications not being affected by "Show deletions of single messages". (#6233)
- Bugfix: Don't add reply buttons to messages that are invalid reply targets. (#6119)
- Bugfix: Fixed invalid commands from being forwarded to Helix, making it possible for information to leak (e.g. if you typed `/bann username ban reason` it would be seen by others in chat as `username ban reason`). (#6272, #6330)
- Bugfix: Fixed a crash that occurs when searching for emotes in channel-less contexts. (#6357)
- Dev: Mini refactor of Split. (#6148)
- Dev: Conan will no longer generate a `CMakeUserPresets.json` file. (#6117)
- Dev: Pass `--force-openssl` when installing from CMake in Qt 6.8+. (#6129)
+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;