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

Show custom emoji in private chat reactions.

This commit is contained in:
John Preston
2022-08-16 20:57:40 +03:00
parent 09124f6424
commit 1e2e007d38
15 changed files with 54 additions and 14 deletions

View File

@@ -18,6 +18,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_changes.h"
#include "data/data_document.h"
#include "data/data_document_media.h"
#include "data/stickers/data_custom_emoji.h"
#include "lottie/lottie_icon.h"
#include "storage/localimageloader.h"
#include "ui/image/image_location_factory.h"
@@ -203,6 +204,16 @@ QImage Reactions::resolveImageFor(
Unexpected("ImageSize in Reactions::resolveImageFor.");
}
std::unique_ptr<Ui::Text::CustomEmoji> Reactions::resolveCustomFor(
const ReactionId &emoji,
ImageSize size) {
const auto custom = std::get_if<DocumentId>(&emoji.data);
if (!custom) {
return nullptr;
}
return _owner->customEmojiManager().create(*custom, [] {});
}
void Reactions::resolveImages() {
for (auto &[id, set] : _images) {
if (!set.bottomInfo.isNull() || set.icon || set.media) {