fix: correctly color usernames in most other notice scenarios (#6323)
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#include "providers/twitch/TwitchChannel.hpp"
|
||||
#include "providers/twitch/TwitchHelpers.hpp"
|
||||
#include "providers/twitch/TwitchIrcServer.hpp"
|
||||
#include "providers/twitch/UserColor.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "singletons/StreamerMode.hpp"
|
||||
#include "singletons/WindowManager.hpp"
|
||||
@@ -669,6 +670,9 @@ void IrcMessageHandler::parseUserNoticeMessageInto(Communi::IrcMessage *message,
|
||||
{
|
||||
assert(channel != nullptr);
|
||||
|
||||
const auto *userDataController = getApp()->getUserData();
|
||||
assert(userDataController != nullptr);
|
||||
|
||||
auto tags = message->tags();
|
||||
auto parameters = message->parameters();
|
||||
|
||||
@@ -833,12 +837,16 @@ void IrcMessageHandler::parseUserNoticeMessageInto(Communi::IrcMessage *message,
|
||||
displayName = login;
|
||||
}
|
||||
|
||||
MessageColor userColor = MessageColor::System;
|
||||
if (auto colorTag = tags.value("color").value<QColor>();
|
||||
colorTag.isValid())
|
||||
{
|
||||
userColor = MessageColor(colorTag);
|
||||
}
|
||||
auto userID = tags.value("user-id").toString();
|
||||
auto userColor = twitch::getUserColor(
|
||||
{
|
||||
.userLogin = login,
|
||||
.userID = userID,
|
||||
.userDataController = userDataController,
|
||||
.channelChatters = channel,
|
||||
.color = tags.value("color").value<QColor>(),
|
||||
})
|
||||
.value_or(MessageColor::System);
|
||||
|
||||
auto msg = MessageBuilder::makeSystemMessageWithUser(
|
||||
parseTagString(messageText), login, displayName, userColor,
|
||||
|
||||
Reference in New Issue
Block a user