Fix autocompletion
Now it will save a map from display name to id and use that to generate clean matrix.to links. This also make sure the colors used for the preview are correct by using NeoChatUser and fix the bug with the regex by simply removing the regex. Fix #234
This commit is contained in:
@@ -266,7 +266,15 @@ QVariantList NeoChatRoom::getUsers(const QString &keyword) const
|
||||
QVariantList matchedList;
|
||||
for (const auto u : userList) {
|
||||
if (u->displayname(this).contains(keyword, Qt::CaseInsensitive)) {
|
||||
matchedList.append(QVariant::fromValue(u));
|
||||
NeoChatUser user(u->id(), u->connection());
|
||||
QVariantMap userVariant {
|
||||
{ QStringLiteral("id"), user.id() },
|
||||
{ QStringLiteral("displayName"), user.displayname(this) },
|
||||
{ QStringLiteral("avatarMediaId"), user.avatarMediaId(this) },
|
||||
{ QStringLiteral("color"), user.color() }
|
||||
};
|
||||
|
||||
matchedList.append(QVariant::fromValue(userVariant));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user