Return stickers from getCustomEmojiReactionAnimations.

This commit is contained in:
levlam 2022-09-30 15:55:46 +03:00
parent 23df775c56
commit d3a2df8858
3 changed files with 8 additions and 17 deletions

View File

@ -163,9 +163,6 @@ remoteFile id:string unique_id:string is_uploading_active:Bool is_uploading_comp
//@remote Information about the remote copy of the file
file id:int32 size:int53 expected_size:int53 local:localFile remote:remoteFile = File;
//@description Represents a list of files @files List of files
files files:vector<file> = Files;
//@class InputFile @description Points to a file
@ -5205,8 +5202,8 @@ editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:Messa
//@description Returns information about a emoji reaction. Returns a 404 error if the reaction is not found @emoji Text representation of the reaction
getEmojiReaction emoji:string = EmojiReaction;
//@description Returns TGS files with generic animations for custom emoji reactions
getCustomEmojiReactionAnimations = Files;
//@description Returns TGS stickers with generic animations for custom emoji reactions
getCustomEmojiReactionAnimations = Stickers;
//@description Returns reactions, which can be added to a message. The list can change after updateActiveEmojiReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message
//@chat_id Identifier of the chat to which the message belongs

View File

@ -2214,12 +2214,8 @@ tl_object_ptr<td_api::sticker> StickersManager::get_sticker_object(FileId file_i
}
tl_object_ptr<td_api::stickers> StickersManager::get_stickers_object(const vector<FileId> &sticker_ids) const {
auto result = td_api::make_object<td_api::stickers>();
result->stickers_.reserve(sticker_ids.size());
for (auto sticker_id : sticker_ids) {
result->stickers_.push_back(get_sticker_object(sticker_id));
}
return result;
return td_api::make_object<td_api::stickers>(
transform(sticker_ids, [&](FileId sticker_id) { return get_sticker_object(sticker_id); }));
}
tl_object_ptr<td_api::DiceStickers> StickersManager::get_dice_stickers_object(const string &emoji, int32 value) const {
@ -5854,14 +5850,14 @@ void StickersManager::get_all_animated_emojis(bool is_recursive,
}
void StickersManager::get_custom_emoji_reaction_generic_animations(
bool is_recursive, Promise<td_api::object_ptr<td_api::files>> &&promise) {
bool is_recursive, Promise<td_api::object_ptr<td_api::stickers>> &&promise) {
TRY_STATUS_PROMISE(promise, G()->close_status());
auto &special_sticker_set = add_special_sticker_set(SpecialStickerSetType::generic_animations());
auto sticker_set = get_sticker_set(special_sticker_set.id_);
if (sticker_set == nullptr || !sticker_set->was_loaded_) {
if (is_recursive) {
return promise.set_value(td_api::make_object<td_api::files>());
return promise.set_value(td_api::make_object<td_api::stickers>());
}
pending_get_generic_animations_queries_.push_back(PromiseCreator::lambda(
@ -5877,9 +5873,7 @@ void StickersManager::get_custom_emoji_reaction_generic_animations(
return;
}
auto files = transform(sticker_set->sticker_ids_,
[&](FileId sticker_id) { return td_->file_manager_->get_file_object(sticker_id); });
promise.set_value(td_api::make_object<td_api::files>(std::move(files)));
promise.set_value(get_stickers_object(sticker_set->sticker_ids_));
}
void StickersManager::get_default_emoji_statuses(bool is_recursive,

View File

@ -104,7 +104,7 @@ class StickersManager final : public Actor {
void get_all_animated_emojis(bool is_recursive, Promise<td_api::object_ptr<td_api::emojis>> &&promise);
void get_custom_emoji_reaction_generic_animations(bool is_recursive,
Promise<td_api::object_ptr<td_api::files>> &&promise);
Promise<td_api::object_ptr<td_api::stickers>> &&promise);
void get_default_emoji_statuses(bool is_recursive, Promise<td_api::object_ptr<td_api::emojiStatuses>> &&promise);