|
|
@ -371,17 +371,17 @@ TimelineItem::replaceEmoji(const QString &body) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QString fmtBody = ""; |
|
|
|
QString fmtBody = ""; |
|
|
|
|
|
|
|
|
|
|
|
for (auto &c : body) { |
|
|
|
QVector<uint> utf32_string = body.toUcs4(); |
|
|
|
int code = c.unicode(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (auto &code : utf32_string) { |
|
|
|
// TODO: Be more precise here.
|
|
|
|
// TODO: Be more precise here.
|
|
|
|
if (code > 9000) |
|
|
|
if (code > 9000) |
|
|
|
fmtBody += QString("<span style=\"font-family: Emoji " |
|
|
|
fmtBody += QString("<span style=\"font-family: Emoji " |
|
|
|
"One; font-size: %1px\">") |
|
|
|
"One; font-size: %1px\">") |
|
|
|
.arg(conf::emojiSize) + |
|
|
|
.arg(conf::emojiSize) + |
|
|
|
QString(c) + "</span>"; |
|
|
|
QString::fromUcs4(&code, 1) + "</span>"; |
|
|
|
else |
|
|
|
else |
|
|
|
fmtBody += c; |
|
|
|
fmtBody += QString::fromUcs4(&code, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return fmtBody; |
|
|
|
return fmtBody; |
|
|
|