mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +03:00
Don't allow images in username change messages and user completer
Sorry, no fun for you!
This commit is contained in:
parent
495a4334df
commit
f9a334233f
2 changed files with 6 additions and 4 deletions
|
@ -42,21 +42,22 @@ UsersModel::data(const QModelIndex &index, int role) const
|
|||
case CompletionModel::CompletionRole:
|
||||
if (UserSettings::instance()->markdown())
|
||||
return QString("[%1](https://matrix.to/#/%2)")
|
||||
.arg(displayNames[index.row()])
|
||||
.arg(displayNames[index.row()].toHtmlEscaped())
|
||||
.arg(QString(QUrl::toPercentEncoding(userids[index.row()])));
|
||||
else
|
||||
return displayNames[index.row()];
|
||||
case CompletionModel::SearchRole:
|
||||
return displayNames[index.row()];
|
||||
case Qt::DisplayRole:
|
||||
case Roles::DisplayName:
|
||||
return displayNames[index.row()];
|
||||
return displayNames[index.row()].toHtmlEscaped();
|
||||
case CompletionModel::SearchRole2:
|
||||
return userids[index.row()];
|
||||
case Roles::AvatarUrl:
|
||||
return cache::avatarUrl(QString::fromStdString(room_id),
|
||||
QString::fromStdString(roomMembers_[index.row()]));
|
||||
case Roles::UserID:
|
||||
return userids[index.row()];
|
||||
return userids[index.row()].toHtmlEscaped();
|
||||
}
|
||||
}
|
||||
return {};
|
||||
|
|
|
@ -1858,7 +1858,8 @@ TimelineModel::formatMemberEvent(QString id)
|
|||
break;
|
||||
case Membership::Join:
|
||||
if (prevEvent && prevEvent->content.membership == Membership::Join) {
|
||||
QString oldName = QString::fromStdString(prevEvent->content.display_name);
|
||||
QString oldName = utils::replaceEmoji(
|
||||
QString::fromStdString(prevEvent->content.display_name).toHtmlEscaped());
|
||||
|
||||
bool displayNameChanged =
|
||||
prevEvent->content.display_name != event->content.display_name;
|
||||
|
|
Loading…
Reference in a new issue