Fixed comma appended to username completion when not at the beginning of the message (#3060)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -68,4 +68,17 @@ QColor getRandomColor(const QString &userId)
|
||||
return TWITCH_USERNAME_COLORS[colorIndex];
|
||||
}
|
||||
|
||||
QString formatUserMention(const QString &userName, bool isFirstWord,
|
||||
bool mentionUsersWithComma)
|
||||
{
|
||||
QString result = userName;
|
||||
|
||||
if (isFirstWord && mentionUsersWithComma)
|
||||
{
|
||||
result += ",";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -20,4 +20,14 @@ QString kFormatNumbers(const int &number);
|
||||
|
||||
QColor getRandomColor(const QString &userId);
|
||||
|
||||
/**
|
||||
* @brief Takes a user's name and some formatting parameter and spits out the standardized way to format it
|
||||
*
|
||||
* @param userName a user's name
|
||||
* @param isFirstWord signifies whether this mention would be the first word in a message
|
||||
* @param mentionUsersWithComma postfix mentions with a comma. generally powered by getSettings()->mentionUsersWithComma
|
||||
**/
|
||||
QString formatUserMention(const QString &userName, bool isFirstWord,
|
||||
bool mentionUsersWithComma);
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
Reference in New Issue
Block a user