Color mentions to match the mentioned users color (#2284)
You can disable this by unchecking "Color @usernames" under `Settings -> General -> Advanced (misc.)` Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -64,9 +64,30 @@ void ChannelChatters::addPartedUser(const QString &user)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void ChannelChatters::setChatters(UsernameSet &&set)
|
||||
{
|
||||
*this->chatters_.access() = set;
|
||||
}
|
||||
|
||||
const QColor ChannelChatters::getUserColor(const QString &user)
|
||||
{
|
||||
const auto chatterColors = this->chatterColors_.access();
|
||||
|
||||
const auto search = chatterColors->find(user.toLower());
|
||||
if (search == chatterColors->end())
|
||||
{
|
||||
// Returns an invalid color so we can decide not to override `textColor`
|
||||
return QColor();
|
||||
}
|
||||
|
||||
return search->second;
|
||||
}
|
||||
|
||||
void ChannelChatters::setUserColor(const QString &user, const QColor &color)
|
||||
{
|
||||
const auto chatterColors = this->chatterColors_.access();
|
||||
chatterColors->insert_or_assign(user.toLower(), color);
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
Reference in New Issue
Block a user