diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-04-24 09:12:50 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-04-24 14:32:24 +0200 |
commit | 6fd485a74a9ffcfd006e4bfefa05052d48effb4b (patch) | |
tree | 217a5043f7467860f78b59a8e464d5c1f21ef7fc /src/UsersModel.cpp | |
parent | Update translation files (diff) | |
download | nheko-6fd485a74a9ffcfd006e4bfefa05052d48effb4b.tar.xz |
Fix completions in plain text mode
Diffstat (limited to '')
-rw-r--r-- | src/UsersModel.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/UsersModel.cpp b/src/UsersModel.cpp index dd77e512..c4379668 100644 --- a/src/UsersModel.cpp +++ b/src/UsersModel.cpp @@ -4,8 +4,11 @@ #include "UsersModel.h" +#include <QUrl> + #include "Cache.h" #include "CompletionModelRoles.h" +#include "UserSettingsPage.h" UsersModel::UsersModel(const std::string &roomId, QObject *parent) : QAbstractListModel(parent) @@ -37,9 +40,12 @@ UsersModel::data(const QModelIndex &index, int role) const if (hasIndex(index.row(), index.column(), index.parent())) { switch (role) { case CompletionModel::CompletionRole: - return QString("[%1](https://matrix.to/#/%2)") - .arg(displayNames[index.row()]) - .arg(userids[index.row()]); + if (UserSettings::instance()->markdown()) + return QString("[%1](https://matrix.to/#/%2)") + .arg(displayNames[index.row()]) + .arg(QString(QUrl::toPercentEncoding(userids[index.row()]))); + else + return displayNames[index.row()]; case CompletionModel::SearchRole: case Qt::DisplayRole: case Roles::DisplayName: |