From 9ef342e4483b27f31318a4879b01ba52ff307e09 Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Thu, 10 Oct 2024 21:32:53 +0200 Subject: [PATCH] Fix emoji detection The previous code considered "123" to be an emoji --- src/utils.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils.cpp b/src/utils.cpp index b35307aed..1e44a8dc2 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -20,7 +20,6 @@ bool QmlUtils::isEmoji(const QString &text) { return Utils::isEmoji(text); } - bool QmlUtils::isValidJson(const QByteArray &json) { return !QJsonDocument::fromJson(json).isNull(); @@ -51,7 +50,7 @@ bool Utils::isEmoji(const QString &text) } auto first = text.mid(from, to - from).toUcs4()[0]; - if (!u_hasBinaryProperty(first, UCHAR_EMOJI)) { + if (!u_hasBinaryProperty(first, UCHAR_EMOJI_PRESENTATION)) { return false; } from = to;