Skip to content

Fix increasing font size of certain emojis

Claire requested to merge blankeclair/neochat:unified-emoji-detector into master

Before this commit, NeoChat has two methods of detecting whether or not a piece of text was an emoji. One is through a regex, and the other is by using the ICU library. The two methods are used in different parts of the code.

This commit removes the regex detector and instead uses ICU for all the places where NeoChat needs to figure out whether or not a string is an emoji. This fixes increasing the font size for messages that only consist of emoji when certain emoji are used that the regex did not handle (such as the transgender symbol and transgender flag emojis).

Before: https://invent.kde.org/-/project/5996/uploads/60bf5023f44647f55a7541b6dd2bbcd1/2024-09-07_18-14_1.png
After: https://invent.kde.org/-/project/5996/uploads/324fc4f346744a1f9fed0e982c9e48ea/2024-09-07_18-14.png

The transgender flag being the white flag + transgender symbol emoji appears to be a Qt bug. This commit was created and tested for v24.08.0 since master requires updated dependencies that I didn't want to bother installing, but I git stash-ed it from v24.08.0 and git stash pop-ed it onto master mostly cleanly (there was a conflict when adding #include "utils.h" in src/models/reactionmodel.cpp, but that was easily fixed).

Edited by Claire

Merge request reports