mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fix crash in name-colorizer
This commit is contained in:
parent
cd5972522b
commit
e56c90c33d
2 changed files with 15 additions and 4 deletions
|
@ -502,17 +502,27 @@ void TwitchMessageBuilder::appendChannelName()
|
||||||
->setLink(link);
|
->setLink(link);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TwitchMessageBuilder::parseUsername()
|
void TwitchMessageBuilder::parseUsernameColor()
|
||||||
{
|
{
|
||||||
const auto iterator = this->tags.find("color");
|
const auto iterator = this->tags.find("color");
|
||||||
if (const auto color = iterator.value().toString(); !color.isEmpty())
|
if (iterator != this->tags.end())
|
||||||
{
|
{
|
||||||
this->usernameColor_ = QColor(color);
|
if (const auto color = iterator.value().toString(); !color.isEmpty())
|
||||||
|
{
|
||||||
|
this->usernameColor_ = QColor(color);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (getSettings()->colorizeNicknames && this->tags.contains("user-id"))
|
|
||||||
|
if (getSettings()->colorizeNicknames && this->tags.contains("user-id"))
|
||||||
{
|
{
|
||||||
this->usernameColor_ = getRandomColor(this->tags.value("user-id"));
|
this->usernameColor_ = getRandomColor(this->tags.value("user-id"));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TwitchMessageBuilder::parseUsername()
|
||||||
|
{
|
||||||
|
this->parseUsernameColor();
|
||||||
|
|
||||||
// username
|
// username
|
||||||
this->userName = this->ircMessage->nick();
|
this->userName = this->ircMessage->nick();
|
||||||
|
|
|
@ -52,6 +52,7 @@ private:
|
||||||
void parseMessageID();
|
void parseMessageID();
|
||||||
void parseRoomID();
|
void parseRoomID();
|
||||||
void appendChannelName();
|
void appendChannelName();
|
||||||
|
void parseUsernameColor();
|
||||||
void parseUsername();
|
void parseUsername();
|
||||||
void appendUsername();
|
void appendUsername();
|
||||||
void runIgnoreReplaces(
|
void runIgnoreReplaces(
|
||||||
|
|
Loading…
Reference in a new issue