diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index e97b560a..76e728c3 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -173,8 +173,9 @@ Rectangle {
Text {
id: userName
- text: chat.model.displayName(section.split(" ")[0])
+ text: chat.model.escapeEmoji(chat.model.displayName(section.split(" ")[0]))
color: chat.model.userColor(section.split(" ")[0], colors.window)
+ textFormat: Text.RichText
}
}
}
diff --git a/src/Utils.cpp b/src/Utils.cpp
index 8c02b1c2..d458dbcc 100644
--- a/src/Utils.cpp
+++ b/src/Utils.cpp
@@ -40,9 +40,8 @@ utils::replaceEmoji(const QString &body)
for (auto &code : utf32_string) {
// TODO: Be more precise here.
if (code > 9000)
- fmtBody +=
- QString("") +
- QString::fromUcs4(&code, 1) + "";
+ fmtBody += QString("") +
+ QString::fromUcs4(&code, 1) + "";
else
fmtBody += QString::fromUcs4(&code, 1);
}
diff --git a/src/timeline2/TimelineModel.cpp b/src/timeline2/TimelineModel.cpp
index c1918d20..dff5e56e 100644
--- a/src/timeline2/TimelineModel.cpp
+++ b/src/timeline2/TimelineModel.cpp
@@ -336,3 +336,9 @@ TimelineModel::formatDateSeparator(QDate date) const
return date.toString(fmt);
}
+
+QString
+TimelineModel::escapeEmoji(QString str) const
+{
+ return utils::replaceEmoji(str);
+}
diff --git a/src/timeline2/TimelineModel.h b/src/timeline2/TimelineModel.h
index 51cb9be3..e37c6542 100644
--- a/src/timeline2/TimelineModel.h
+++ b/src/timeline2/TimelineModel.h
@@ -91,6 +91,7 @@ public:
Q_INVOKABLE QColor userColor(QString id, QColor background);
Q_INVOKABLE QString displayName(QString id) const;
Q_INVOKABLE QString formatDateSeparator(QDate date) const;
+ Q_INVOKABLE QString escapeEmoji(QString str) const;
void addEvents(const mtx::responses::Timeline &events);