From 7685d1808bf97fb74914b97ed99f48ec7cc690c0 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sat, 1 Jan 2022 06:37:15 +0100 Subject: Strip variant selector in some cases fixes #439 Workaround for https://bugreports.qt.io/browse/QTBUG-97401 fixes #810 --- src/Utils.cpp | 7 ++++++- src/timeline/Reaction.h | 12 +++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/Utils.cpp b/src/Utils.cpp index 175b2770..75b3c8f2 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -135,8 +135,13 @@ utils::replaceEmoji(const QString &body) fmtBody += QStringLiteral("emojiFont() % QStringLiteral("\">"); insideFontBlock = true; + } else if (code == 0xfe0f) { + // BUG(Nico): + // Workaround https://bugreports.qt.io/browse/QTBUG-97401 + // See also https://github.com/matrix-org/matrix-react-sdk/pull/1458/files + // Nheko bug: https://github.com/Nheko-Reborn/nheko/issues/439 + continue; } - } else { if (insideFontBlock) { fmtBody += QStringLiteral(""); diff --git a/src/timeline/Reaction.h b/src/timeline/Reaction.h index ef8d36ea..9ed3f801 100644 --- a/src/timeline/Reaction.h +++ b/src/timeline/Reaction.h @@ -11,13 +11,15 @@ struct Reaction { Q_GADGET - Q_PROPERTY(QString key READ key) - Q_PROPERTY(QString users READ users) - Q_PROPERTY(QString selfReactedEvent READ selfReactedEvent) - Q_PROPERTY(int count READ count) + Q_PROPERTY(QString key READ key CONSTANT) + Q_PROPERTY(QString displayKey READ displayKey CONSTANT) + Q_PROPERTY(QString users READ users CONSTANT) + Q_PROPERTY(QString selfReactedEvent READ selfReactedEvent CONSTANT) + Q_PROPERTY(int count READ count CONSTANT) public: - QString key() const { return key_.toHtmlEscaped(); } + QString key() const { return key_; } + QString displayKey() const { return key_.toHtmlEscaped().remove(QStringLiteral(u"\ufe0f")); } QString users() const { return users_.toHtmlEscaped(); } QString selfReactedEvent() const { return selfReactedEvent_; } int count() const { return count_; } -- cgit 1.5.1