Fix colors in typing display, when username contains emoji

This commit is contained in:
Nicolas Werner 2020-01-21 20:41:09 +01:00
parent 79e4e2e6e1
commit c95f4d8276
4 changed files with 35 additions and 5 deletions

View file

@ -39,7 +39,7 @@ utils::replaceEmoji(const QString &body)
QSettings settings;
QString userFontFamily = settings.value("user/emoji_font_family", "emoji").toString();
bool insideFontBlock = true;
bool insideFontBlock = false;
for (auto &code : utf32_string) {
// TODO: Be more precise here.
if ((code >= 0x2600 && code <= 0x27bf) || (code >= 0x1f300 && code <= 0x1f3ff) ||
@ -57,6 +57,9 @@ utils::replaceEmoji(const QString &body)
}
fmtBody += QString::fromUcs4(&code, 1);
}
if (insideFontBlock) {
fmtBody += "</font>";
}
return fmtBody;
}