Fix some html escaping in room settings
This commit is contained in:
parent
410c4efdf8
commit
f25c68d439
4 changed files with 22 additions and 3 deletions
|
|
@ -65,7 +65,7 @@ ApplicationWindow {
|
|||
}
|
||||
TextEdit {
|
||||
readOnly: true
|
||||
textFormat: TextEdit.RichText
|
||||
textFormat: TextEdit.PlainText
|
||||
text: summary.roomid
|
||||
font.pixelSize: fontMetrics.font.pixelSize * 0.8
|
||||
color: palette.text
|
||||
|
|
|
|||
|
|
@ -656,6 +656,7 @@ ApplicationWindow {
|
|||
Label { // TextEdit does not trigger onClicked
|
||||
id: idLabel
|
||||
text: roomSettings.roomId
|
||||
textFormat: Text.PlainText
|
||||
font.pixelSize: Math.floor(fontMetrics.font.pixelSize * 0.8)
|
||||
color: palette.text
|
||||
width: parent.width
|
||||
|
|
@ -666,6 +667,7 @@ ApplicationWindow {
|
|||
}
|
||||
TextEdit{ // label does not allow selection
|
||||
id: textEdit
|
||||
textFormat: TextEdit.PlainText
|
||||
visible: false
|
||||
text: roomSettings.roomId
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include "Cache.h"
|
||||
#include "ChatPage.h"
|
||||
#include "MatrixClient.h"
|
||||
#include "Utils.h"
|
||||
|
||||
RoomSummary::RoomSummary(std::string roomIdOrAlias_,
|
||||
std::vector<std::string> vias_,
|
||||
|
|
@ -76,6 +77,22 @@ RoomSummary::RoomSummary(std::string roomIdOrAlias_,
|
|||
vias);
|
||||
}
|
||||
|
||||
QString
|
||||
RoomSummary::roomName() const
|
||||
{
|
||||
return utils::replaceEmoji(
|
||||
QString::fromStdString(room ? room->name : roomIdOrAlias).toHtmlEscaped());
|
||||
}
|
||||
QString
|
||||
RoomSummary::roomTopic() const
|
||||
{
|
||||
return room ? utils::replaceEmoji(
|
||||
utils::linkifyMessage(QString::fromStdString(room->topic)
|
||||
.toHtmlEscaped()
|
||||
.replace(QLatin1String("\n"), QLatin1String("<br>"))))
|
||||
: "";
|
||||
}
|
||||
|
||||
void
|
||||
RoomSummary::join()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -55,8 +55,8 @@ public:
|
|||
QString reason() const { return reason_; }
|
||||
|
||||
QString roomid() const { return room ? QString::fromStdString(room->room_id) : ""; }
|
||||
QString roomName() const { return QString::fromStdString(room ? room->name : roomIdOrAlias); }
|
||||
QString roomTopic() const { return room ? QString::fromStdString(room->topic) : ""; }
|
||||
QString roomName() const;
|
||||
QString roomTopic() const;
|
||||
QString roomAvatarUrl() const { return room ? QString::fromStdString(room->avatar_url) : ""; }
|
||||
bool isInvite() const
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue