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:
@@ -10,6 +10,7 @@
|
||||
#include "providers/twitch/TwitchIrcServer.hpp"
|
||||
#include "singletons/Emotes.hpp"
|
||||
#include "singletons/Settings.hpp"
|
||||
#include "util/Helpers.hpp"
|
||||
#include "util/QStringHash.hpp"
|
||||
|
||||
#include <QtAlgorithms>
|
||||
@@ -150,9 +151,6 @@ void CompletionModel::refresh(const QString &prefix, bool isFirstWord)
|
||||
}
|
||||
|
||||
// Usernames
|
||||
QString usernamePostfix =
|
||||
isFirstWord && getSettings()->mentionUsersWithComma ? "," : QString();
|
||||
|
||||
if (prefix.startsWith("@"))
|
||||
{
|
||||
QString usernamePrefix = prefix;
|
||||
@@ -162,8 +160,10 @@ void CompletionModel::refresh(const QString &prefix, bool isFirstWord)
|
||||
|
||||
for (const auto &name : chatters)
|
||||
{
|
||||
addString("@" + name + usernamePostfix,
|
||||
TaggedString::Type::Username);
|
||||
addString(
|
||||
"@" + formatUserMention(name, isFirstWord,
|
||||
getSettings()->mentionUsersWithComma),
|
||||
TaggedString::Type::Username);
|
||||
}
|
||||
}
|
||||
else if (!getSettings()->userCompletionOnlyWithAt)
|
||||
@@ -172,7 +172,9 @@ void CompletionModel::refresh(const QString &prefix, bool isFirstWord)
|
||||
|
||||
for (const auto &name : chatters)
|
||||
{
|
||||
addString(name + usernamePostfix, TaggedString::Type::Username);
|
||||
addString(formatUserMention(name, isFirstWord,
|
||||
getSettings()->mentionUsersWithComma),
|
||||
TaggedString::Type::Username);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user