diff options
-rw-r--r-- | resources/qml/TopBar.qml | 3 | ||||
-rw-r--r-- | src/RoomsModel.cpp | 5 | ||||
-rw-r--r-- | src/timeline/TimelineModel.cpp | 13 | ||||
-rw-r--r-- | src/ui/RoomSettings.cpp | 5 |
4 files changed, 17 insertions, 9 deletions
diff --git a/resources/qml/TopBar.qml b/resources/qml/TopBar.qml index 188f456b..f5c5c84a 100644 --- a/resources/qml/TopBar.qml +++ b/resources/qml/TopBar.qml @@ -72,7 +72,8 @@ Rectangle { font.pointSize: fontMetrics.font.pointSize * 1.1 text: room ? room.roomName : qsTr("No room selected") maximumLineCount: 1 - elide: Text.ElideRight + elide: Text.ElideRight + textFormat: Text.RichText } MatrixText { diff --git a/src/RoomsModel.cpp b/src/RoomsModel.cpp index 28ffb6e1..5df756f1 100644 --- a/src/RoomsModel.cpp +++ b/src/RoomsModel.cpp @@ -62,10 +62,11 @@ RoomsModel::data(const QModelIndex &index, int role) const case CompletionModel::SearchRole: case Qt::DisplayRole: case Roles::RoomAlias: - return roomAliases[index.row()]; + return roomAliases[index.row()].toHtmlEscaped(); case CompletionModel::SearchRole2: case Roles::RoomName: - return QString::fromStdString(roomInfos.at(roomids[index.row()]).name); + return QString::fromStdString(roomInfos.at(roomids[index.row()]).name) + .toHtmlEscaped(); case Roles::AvatarUrl: return QString::fromStdString( roomInfos.at(roomids[index.row()]).avatar_url); diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp index 6108df1c..bfd95b0d 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp @@ -474,9 +474,13 @@ TimelineModel::data(const mtx::events::collections::TimelineEvents &event, int r case RoomId: return QVariant(room_id_); case RoomName: - return QVariant(QString::fromStdString(room_name(event))); + return QVariant( + utils::replaceEmoji(QString::fromStdString(room_name(event)).toHtmlEscaped())); case RoomTopic: - return QVariant(QString::fromStdString(room_topic(event))); + return QVariant(utils::replaceEmoji( + utils::linkifyMessage(QString::fromStdString(room_topic(event)) + .toHtmlEscaped() + .replace("\n", "<br>")))); case CallType: return QVariant(QString::fromStdString(call_type(event))); case Dump: { @@ -1633,7 +1637,8 @@ TimelineModel::roomName() const if (!info.count(room_id_)) return ""; else - return QString::fromStdString(info[room_id_].name); + return utils::replaceEmoji( + QString::fromStdString(info[room_id_].name).toHtmlEscaped()); } QString @@ -1656,5 +1661,5 @@ TimelineModel::roomTopic() const return ""; else return utils::replaceEmoji(utils::linkifyMessage( - utils::escapeBlacklistedHtml(QString::fromStdString(info[room_id_].topic)))); + QString::fromStdString(info[room_id_].topic).toHtmlEscaped())); } diff --git a/src/ui/RoomSettings.cpp b/src/ui/RoomSettings.cpp index cb82cc4e..0bc8759e 100644 --- a/src/ui/RoomSettings.cpp +++ b/src/ui/RoomSettings.cpp @@ -227,13 +227,14 @@ RoomSettings::RoomSettings(QString roomid, QObject *parent) QString RoomSettings::roomName() const { - return QString::fromStdString(info_.name); + return utils::replaceEmoji(QString::fromStdString(info_.name).toHtmlEscaped()); } QString RoomSettings::roomTopic() const { - return utils::linkifyMessage(QString::fromStdString(info_.topic).toHtmlEscaped()); + return utils::replaceEmoji(utils::linkifyMessage( + QString::fromStdString(info_.topic).toHtmlEscaped().replace("\n", "<br>"))); } QString |