fix: resolve /live channel liveness using their channel ID (#5172)

This commit is contained in:
KleberPF 2024-02-17 08:22:49 -03:00 committed by GitHub
parent 4a5d4ef3fa
commit 3cdb7bf4f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 4 deletions

View file

@ -52,6 +52,7 @@
- Bugfix: Fixed double-click text selection moving its position with each new message. (#4898)
- Bugfix: Fixed an issue where notifications on Windows would contain no or an old avatar. (#4899)
- Bugfix: Fixed headers of tables in the settings switching to bold text when selected. (#4913)
- Bugfix: Fixed an issue in the `/live` split that caused some channels to not get grayed-out when they went offline. (#5172)
- Bugfix: Fixed tooltips appearing too large and/or away from the cursor. (#4920)
- Bugfix: Fixed a crash when clicking `More messages below` button in a usercard and closing it quickly. (#4933)
- Bugfix: Fixed thread popup window missing messages for nested threads. (#4923)

View file

@ -227,7 +227,8 @@ void NotificationController::removeFakeChannel(const QString channelName)
{
const auto &s = snapshot[i];
if (s->messageText == liveMessageSearchText)
if (QString::compare(s->messageText, liveMessageSearchText,
Qt::CaseInsensitive) == 0)
{
s->flags.set(MessageFlag::Disabled);
break;

View file

@ -164,12 +164,14 @@ TwitchChannel::TwitchChannel(const QString &name)
MessageBuilder builder;
TwitchMessageBuilder::liveSystemMessage(this->getDisplayName(),
&builder);
builder.message().id = this->roomId();
this->addMessage(builder.release());
// Message in /live channel
MessageBuilder builder2;
TwitchMessageBuilder::liveMessage(this->getDisplayName(),
&builder2);
builder2.message().id = this->roomId();
getApp()->twitch->liveChannel->addMessage(builder2.release());
// Notify on all channels with a ping sound
@ -197,14 +199,12 @@ TwitchChannel::TwitchChannel(const QString &name)
// MSVC hates this code if the parens are not there
int end = (std::max)(0, snapshotLength - 200);
auto liveMessageSearchText =
QString("%1 is live!").arg(this->getDisplayName());
for (int i = snapshotLength - 1; i >= end; --i)
{
const auto &s = snapshot[i];
if (s->messageText == liveMessageSearchText)
if (s->id == this->roomId())
{
s->flags.set(MessageFlag::Disabled);
break;