diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 4ece67ac1..5517acb86 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -7993,17 +7993,17 @@ checkStickerSetName name:string = CheckStickerSetNameResult; createNewStickerSet user_id:int53 title:string name:string sticker_format:StickerFormat sticker_type:StickerType needs_repainting:Bool stickers:vector source:string = StickerSet; -//@description Adds a new sticker to a set; for bots only. Returns the sticker set +//@description Adds a new sticker to a set; for bots only //@user_id Sticker set owner //@name Sticker set name //@sticker Sticker to add to the set addStickerToSet user_id:int53 name:string sticker:inputSticker = Ok; -//@description Sets a sticker set thumbnail; for bots only. Returns the sticker set +//@description Sets a sticker set thumbnail; for bots only //@user_id Sticker set owner //@name Sticker set name //@thumbnail Thumbnail to set in PNG, TGS, or WEBM format; pass null to remove the sticker set thumbnail. Thumbnail format must match the format of stickers in the set -setStickerSetThumbnail user_id:int53 name:string thumbnail:InputFile = StickerSet; +setStickerSetThumbnail user_id:int53 name:string thumbnail:InputFile = Ok; //@description Sets a custom emoji sticker set thumbnail; for bots only //@name Sticker set name diff --git a/td/telegram/StickersManager.cpp b/td/telegram/StickersManager.cpp index 61b32a9e5..1d1ff844c 100644 --- a/td/telegram/StickersManager.cpp +++ b/td/telegram/StickersManager.cpp @@ -1219,11 +1219,10 @@ class AddStickerToSetQuery final : public Td::ResultHandler { }; class SetStickerSetThumbnailQuery final : public Td::ResultHandler { - Promise> promise_; + Promise promise_; public: - explicit SetStickerSetThumbnailQuery(Promise> &&promise) - : promise_(std::move(promise)) { + explicit SetStickerSetThumbnailQuery(Promise &&promise) : promise_(std::move(promise)) { } void send(const string &short_name, tl_object_ptr &&input_document) { @@ -1245,7 +1244,7 @@ class SetStickerSetThumbnailQuery final : public Td::ResultHandler { if (!sticker_set_id.is_valid()) { return on_error(Status::Error(500, "Sticker set not found")); } - promise_.set_value(td_->stickers_manager_->get_sticker_set_object(sticker_set_id)); + promise_.set_value(Unit()); } void on_error(Status status) final { @@ -8541,8 +8540,7 @@ void StickersManager::on_added_sticker_uploaded(int64 random_id, Result re } void StickersManager::set_sticker_set_thumbnail(UserId user_id, string short_name, - tl_object_ptr &&thumbnail, - Promise> &&promise) { + tl_object_ptr &&thumbnail, Promise &&promise) { TRY_RESULT_PROMISE(promise, input_user, td_->contacts_manager_->get_input_user(user_id)); short_name = clean_username(strip_empty_characters(short_name, MAX_STICKER_SET_SHORT_NAME_LENGTH)); @@ -8571,7 +8569,7 @@ void StickersManager::set_sticker_set_thumbnail(UserId user_id, string short_nam void StickersManager::do_set_sticker_set_thumbnail(UserId user_id, string short_name, tl_object_ptr &&thumbnail, - Promise> &&promise) { + Promise &&promise) { TRY_STATUS_PROMISE(promise, G()->close_status()); const StickerSet *sticker_set = get_sticker_set(short_name_to_sticker_set_id_.get(short_name)); diff --git a/td/telegram/StickersManager.h b/td/telegram/StickersManager.h index 6a002bca0..ead1088f6 100644 --- a/td/telegram/StickersManager.h +++ b/td/telegram/StickersManager.h @@ -309,7 +309,7 @@ class StickersManager final : public Actor { Promise &&promise); void set_sticker_set_thumbnail(UserId user_id, string short_name, tl_object_ptr &&thumbnail, - Promise> &&promise); + Promise &&promise); void set_custom_emoji_sticker_set_thumbnail(string short_name, CustomEmojiId custom_emoji_id, Promise &&promise); @@ -546,7 +546,7 @@ class StickersManager final : public Actor { struct PendingSetStickerSetThumbnail { string short_name_; FileId file_id_; - Promise> promise_; + Promise promise_; }; struct PendingGetAnimatedEmojiClickSticker { @@ -880,7 +880,7 @@ class StickersManager final : public Actor { void on_sticker_set_thumbnail_uploaded(int64 random_id, Result result); void do_set_sticker_set_thumbnail(UserId user_id, string short_name, tl_object_ptr &&thumbnail, - Promise> &&promise); + Promise &&promise); void do_set_custom_emoji_sticker_set_thumbnail(string short_name, CustomEmojiId custom_emoji_id, Promise &&promise); diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 13f8e4fbf..06e01e027 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -7303,7 +7303,7 @@ void Td::on_request(uint64 id, td_api::addStickerToSet &request) { void Td::on_request(uint64 id, td_api::setStickerSetThumbnail &request) { CHECK_IS_BOT(); CLEAN_INPUT_STRING(request.name_); - CREATE_REQUEST_PROMISE(); + CREATE_OK_REQUEST_PROMISE(); stickers_manager_->set_sticker_set_thumbnail(UserId(request.user_id_), std::move(request.name_), std::move(request.thumbnail_), std::move(promise)); }