fix: use irc-unknown when irc server couldn't be loaded (#5419)

This commit is contained in:
pajlada 2024-05-25 13:53:37 +02:00 committed by GitHub
parent 491b6db72f
commit c5802a0f49
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View file

@ -8,6 +8,7 @@
- Minor: Colored usernames now update on the fly when changing the "Color @usernames" setting. (#5300) - Minor: Colored usernames now update on the fly when changing the "Color @usernames" setting. (#5300)
- Minor: Added `flags.action` filter variable, allowing you to filter on `/me` messages. (#5397) - Minor: Added `flags.action` filter variable, allowing you to filter on `/me` messages. (#5397)
- Bugfix: If a network request errors with 200 OK, Qt's error code is now reported instead of the HTTP status. (#5378) - Bugfix: If a network request errors with 200 OK, Qt's error code is now reported instead of the HTTP status. (#5378)
- Bugfix: Fixed a crash that could occur when logging was enabled in IRC servers that were removed. (#5419)
- Dev: Use Qt's high DPI scaling. (#4868, #5400) - Dev: Use Qt's high DPI scaling. (#4868, #5400)
- Dev: Add doxygen build target. (#5377) - Dev: Add doxygen build target. (#5377)
- Dev: Make printing of strings in tests easier. (#5379) - Dev: Make printing of strings in tests easier. (#5379)

View file

@ -91,10 +91,18 @@ void Channel::addMessage(MessagePtr message,
{ {
auto *irc = dynamic_cast<IrcChannel *>(this); auto *irc = dynamic_cast<IrcChannel *>(this);
if (irc != nullptr) if (irc != nullptr)
{
auto *ircServer = irc->server();
if (ircServer != nullptr)
{ {
channelPlatform = QString("irc-%1").arg( channelPlatform = QString("irc-%1").arg(
irc->server()->userFriendlyIdentifier()); irc->server()->userFriendlyIdentifier());
} }
else
{
channelPlatform = "irc-unknown";
}
}
} }
else if (this->isTwitchChannel()) else if (this->isTwitchChannel())
{ {