diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-01-01 06:37:15 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-01-01 07:10:12 +0100 |
commit | 7685d1808bf97fb74914b97ed99f48ec7cc690c0 (patch) | |
tree | 52995d3b4eb0d5d34b80e0754e536dd491f4b86e /src | |
parent | Use fully qualified emoji and use literals (diff) | |
download | nheko-7685d1808bf97fb74914b97ed99f48ec7cc690c0.tar.xz |
Strip variant selector in some cases
fixes #439 Workaround for https://bugreports.qt.io/browse/QTBUG-97401 fixes #810
Diffstat (limited to 'src')
-rw-r--r-- | src/Utils.cpp | 7 | ||||
-rw-r--r-- | src/timeline/Reaction.h | 12 |
2 files changed, 13 insertions, 6 deletions
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("<font face=\"") % UserSettings::instance()->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("</font>"); 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_; } |