diff --git a/td/telegram/StickersManager.cpp b/td/telegram/StickersManager.cpp index f9ea72238..7b4373a88 100644 --- a/td/telegram/StickersManager.cpp +++ b/td/telegram/StickersManager.cpp @@ -8048,8 +8048,8 @@ Result> StickersManager::prepare_input_file( return std::make_tuple(file_id, is_url, is_local); } -FileId StickersManager::upload_sticker_file(UserId user_id, td_api::object_ptr &&sticker_format, - td_api::object_ptr &&input_file, +FileId StickersManager::upload_sticker_file(UserId user_id, StickerFormat sticker_format, + const td_api::object_ptr &input_file, Promise &&promise) { bool is_bot = td_->auth_manager_->is_bot(); if (!is_bot) { @@ -8062,13 +8062,13 @@ FileId StickersManager::upload_sticker_file(UserId user_id, td_api::object_ptr &custom_emoji_ids); - FileId upload_sticker_file(UserId user_id, td_api::object_ptr &&sticker_format, - td_api::object_ptr &&input_file, Promise &&promise); + FileId upload_sticker_file(UserId user_id, StickerFormat sticker_format, + const td_api::object_ptr &input_file, Promise &&promise); void get_suggested_sticker_set_name(string title, Promise &&promise); diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 92ff0714a..7ebec7921 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -2194,14 +2194,13 @@ class ChangeStickerSetRequest final : public RequestOnceActor { class UploadStickerFileRequest final : public RequestOnceActor { UserId user_id_; - td_api::object_ptr sticker_format_; + StickerFormat sticker_format_; td_api::object_ptr input_file_; FileId file_id; void do_run(Promise &&promise) final { - file_id = td_->stickers_manager_->upload_sticker_file(user_id_, std::move(sticker_format_), std::move(input_file_), - std::move(promise)); + file_id = td_->stickers_manager_->upload_sticker_file(user_id_, sticker_format_, input_file_, std::move(promise)); } void do_send_result() final { @@ -2209,12 +2208,11 @@ class UploadStickerFileRequest final : public RequestOnceActor { } public: - UploadStickerFileRequest(ActorShared td, uint64 request_id, int64 user_id, - td_api::object_ptr sticker_format_, + UploadStickerFileRequest(ActorShared td, uint64 request_id, int64 user_id, StickerFormat sticker_format, td_api::object_ptr input_file) : RequestOnceActor(std::move(td), request_id) , user_id_(user_id) - , sticker_format_(std::move(sticker_format_)) + , sticker_format_(sticker_format) , input_file_(std::move(input_file)) { } }; @@ -7252,7 +7250,7 @@ void Td::on_request(uint64 id, td_api::reorderInstalledStickerSets &request) { } void Td::on_request(uint64 id, td_api::uploadStickerFile &request) { - CREATE_REQUEST(UploadStickerFileRequest, request.user_id_, std::move(request.sticker_format_), + CREATE_REQUEST(UploadStickerFileRequest, request.user_id_, get_sticker_format(request.sticker_format_), std::move(request.sticker_)); }