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: 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: 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 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: Mini refactor of Split. (#6148)
- Dev: Conan will no longer generate a `CMakeUserPresets.json` file. (#6117) - Dev: Conan will no longer generate a `CMakeUserPresets.json` file. (#6117)
- Dev: Pass `--force-openssl` when installing from CMake in Qt 6.8+. (#6129) - Dev: Pass `--force-openssl` when installing from CMake in Qt 6.8+. (#6129)
+19 -27
View File
@@ -422,11 +422,6 @@ void EmotePopup::loadChannel(ChannelPtr channel)
this->setWindowTitle("Emotes in #" + this->channel_->getName()); this->setWindowTitle("Emotes in #" + this->channel_->getName());
if (this->twitchChannel_ == nullptr)
{
return;
}
this->globalEmotesView_->setChannel( this->globalEmotesView_->setChannel(
std::make_shared<Channel>("", Channel::Type::None)); std::make_shared<Channel>("", Channel::Type::None));
this->subEmotesView_->setChannel( this->subEmotesView_->setChannel(
@@ -441,11 +436,6 @@ void EmotePopup::loadChannel(ChannelPtr channel)
void EmotePopup::reloadEmotes() void EmotePopup::reloadEmotes()
{ {
if (this->twitchChannel_ == nullptr)
{
return;
}
auto subChannel = this->subEmotesView_->underlyingChannel(); auto subChannel = this->subEmotesView_->underlyingChannel();
auto globalChannel = this->globalEmotesView_->underlyingChannel(); auto globalChannel = this->globalEmotesView_->underlyingChannel();
auto channelChannel = this->channelEmotesView_->underlyingChannel(); auto channelChannel = this->channelEmotesView_->underlyingChannel();
@@ -454,6 +444,8 @@ void EmotePopup::reloadEmotes()
globalChannel->clearMessages(); globalChannel->clearMessages();
channelChannel->clearMessages(); channelChannel->clearMessages();
if (this->twitchChannel_)
{
// twitch // twitch
addTwitchEmoteSets( addTwitchEmoteSets(
twitchChannel_->localTwitchEmotes(), twitchChannel_->localTwitchEmotes(),
@@ -461,23 +453,6 @@ void EmotePopup::reloadEmotes()
*globalChannel, *subChannel, twitchChannel_->roomId(), *globalChannel, *subChannel, twitchChannel_->roomId(),
twitchChannel_->getName()); twitchChannel_->getName());
// global
if (Settings::instance().enableBTTVGlobalEmotes)
{
addEmotes(*globalChannel, *getApp()->getBttvEmotes()->emotes(),
"BetterTTV", MessageElementFlag::BttvEmote);
}
if (Settings::instance().enableFFZGlobalEmotes)
{
addEmotes(*globalChannel, *getApp()->getFfzEmotes()->emotes(),
"FrankerFaceZ", MessageElementFlag::FfzEmote);
}
if (Settings::instance().enableSevenTVGlobalEmotes)
{
addEmotes(*globalChannel, *getApp()->getSeventvEmotes()->globalEmotes(),
"7TV", MessageElementFlag::SevenTVEmote);
}
// channel // channel
if (Settings::instance().enableBTTVChannelEmotes) if (Settings::instance().enableBTTVChannelEmotes)
{ {
@@ -494,6 +469,23 @@ void EmotePopup::reloadEmotes()
addEmotes(*channelChannel, *this->twitchChannel_->seventvEmotes(), addEmotes(*channelChannel, *this->twitchChannel_->seventvEmotes(),
"7TV", MessageElementFlag::SevenTVEmote); "7TV", MessageElementFlag::SevenTVEmote);
} }
}
// global
if (Settings::instance().enableBTTVGlobalEmotes)
{
addEmotes(*globalChannel, *getApp()->getBttvEmotes()->emotes(),
"BetterTTV", MessageElementFlag::BttvEmote);
}
if (Settings::instance().enableFFZGlobalEmotes)
{
addEmotes(*globalChannel, *getApp()->getFfzEmotes()->emotes(),
"FrankerFaceZ", MessageElementFlag::FfzEmote);
}
if (Settings::instance().enableSevenTVGlobalEmotes)
{
addEmotes(*globalChannel, *getApp()->getSeventvEmotes()->globalEmotes(),
"7TV", MessageElementFlag::SevenTVEmote);
}
if (subChannel->getMessageSnapshot().size() == 0) if (subChannel->getMessageSnapshot().size() == 0)
{ {