ref: replace fluff to get username QColor with QVariant.value<QColor>

This commit is contained in:
James Upjohn 2024-10-19 20:39:20 +13:00
parent afe3487bd9
commit c6204743a6
No known key found for this signature in database
GPG key ID: C2A35391BA777173

View file

@ -539,10 +539,10 @@ std::vector<MessagePtr> parseUserNoticeMessage(Channel *channel,
{ {
auto login = loginTag.value().toString(); auto login = loginTag.value().toString();
MessageColor color = MessageColor::System; MessageColor color = MessageColor::System;
if (auto colorTag = tags.find("color"); colorTag != tags.end()) if (auto colorTag = tags.value("color").value<QColor>();
colorTag.isValid())
{ {
// Blindly trust that it's a valid hex code color = MessageColor(colorTag);
color = MessageColor(QColor{colorTag.value().toString()});
} }
auto displayName = displayNameTag.value().toString(); auto displayName = displayNameTag.value().toString();