fixed resub messages

This commit is contained in:
fourtf
2018-06-04 12:23:23 +02:00
parent 04b7cc5ce8
commit 4a2709cbc3
14 changed files with 141 additions and 36 deletions
@@ -292,6 +292,21 @@ void TwitchMessageBuilder::parseUsername()
this->userName = this->tags.value(QLatin1String("login")).toString();
}
if (this->args.trimSubscriberUsername) {
static QRegularExpression fixName("^tmi.twitch.tv\\((\\w+)\\)$");
auto match = fixName.match(this->userName);
if (match.hasMatch()) {
this->userName = match.captured(1);
}
}
// display name
// auto displayNameVariant = this->tags.value("display-name");
// if (displayNameVariant.isValid()) {
// this->userName = displayNameVariant.toString() + " (" + this->userName + ")";
// }
this->message->loginName = this->userName;
}