2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

beautiful sticker blur and selection, document and sticker thumbs fixed, sticker emojis in dialog list display done, send image as doc for bad image size done

This commit is contained in:
John Preston
2015-01-05 23:17:33 +03:00
parent 5d54d48f70
commit 476ffca228
27 changed files with 442 additions and 146 deletions

View File

@@ -336,6 +336,26 @@ const QChar *textSkipCommand(const QChar *from, const QChar *end, bool canLink)
return (result < end && *result == TextCommand) ? (result + 1) : from;
}
QString textEmojiString(EmojiPtr emoji) {
QString result;
result.reserve(emoji->len + (emoji->postfix ? 1 : 0));
switch (emoji->len) {
case 1: result.append(QChar(emoji->code & 0xFFFF)); break;
case 2:
result.append(QChar((emoji->code >> 16) & 0xFFFF));
result.append(QChar(emoji->code & 0xFFFF));
break;
case 4:
result.append(QChar((emoji->code >> 16) & 0xFFFF));
result.append(QChar(emoji->code & 0xFFFF));
result.append(QChar((emoji->code2 >> 16) & 0xFFFF));
result.append(QChar(emoji->code2 & 0xFFFF));
break;
}
if (emoji->postfix) result.append(QChar(emoji->postfix));
return result;
}
class TextParser {
public: