Make join and part messages have user links (#3358)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Mm2PL
2021-11-20 13:53:05 +00:00
committed by GitHub
parent 3a5c2b1d33
commit b94e21a600
5 changed files with 20 additions and 15 deletions
@@ -1460,10 +1460,10 @@ void TwitchMessageBuilder::deletionMessage(const DeleteAction &action,
builder->message().timeoutUser = "msg:" + action.messageId;
}
void TwitchMessageBuilder::modsOrVipsSystemMessage(QString prefix,
QStringList users,
TwitchChannel *channel,
MessageBuilder *builder)
void TwitchMessageBuilder::listOfUsersSystemMessage(QString prefix,
QStringList users,
Channel *channel,
MessageBuilder *builder)
{
builder->emplace<TimestampElement>();
builder->message().flags.set(MessageFlag::System);
@@ -1471,6 +1471,7 @@ void TwitchMessageBuilder::modsOrVipsSystemMessage(QString prefix,
builder->emplace<TextElement>(prefix, MessageElementFlag::Text,
MessageColor::System);
bool isFirst = true;
auto tc = dynamic_cast<TwitchChannel *>(channel);
for (const QString &username : users)
{
if (!isFirst)
@@ -1483,9 +1484,9 @@ void TwitchMessageBuilder::modsOrVipsSystemMessage(QString prefix,
MessageColor color = MessageColor::System;
if (getSettings()->colorUsernames)
if (tc && getSettings()->colorUsernames)
{
if (auto userColor = channel->getUserColor(username);
if (auto userColor = tc->getUserColor(username);
userColor.isValid())
{
color = MessageColor(userColor);