aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2022-06-06 16:33:42 +0300
committerlevlam <levlam@telegram.org>2022-06-06 16:33:42 +0300
commitba6f4c2e8d476482cdf2956672f1505434be1085 (patch)
tree6cc85e8fa1f00f59d0c7ac2f457126e19545056b
parentb10216322068553fa2f5841762c4106c429fe520 (diff)
Add Sticker.premium_animation.
-rw-r--r--telegram-bot-api/Client.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp
index b7a87c7..ca5db6a 100644
--- a/telegram-bot-api/Client.cpp
+++ b/telegram-bot-api/Client.cpp
@@ -283,16 +283,18 @@ bool Client::init_methods() {
class Client::JsonFile final : public Jsonable {
public:
- JsonFile(const td_api::file *file, const Client *client) : file_(file), client_(client) {
+ JsonFile(const td_api::file *file, const Client *client, bool with_path)
+ : file_(file), client_(client), with_path_(with_path) {
}
void store(JsonValueScope *scope) const {
auto object = scope->enter_object();
- client_->json_store_file(object, file_, true);
+ client_->json_store_file(object, file_, with_path_);
}
private:
const td_api::file *file_;
const Client *client_;
+ bool with_path_;
};
class Client::JsonDatedFile final : public Jsonable {
@@ -1021,6 +1023,9 @@ class Client::JsonSticker final : public Jsonable {
object("mask_position", JsonMaskPosition(mask_position.get()));
}
}
+ if (sticker_->premium_animation_ != nullptr) {
+ object("premium_animation", JsonFile(sticker_->premium_animation_.get(), client_, false));
+ }
client_->json_store_thumbnail(object, sticker_->thumbnail_.get());
client_->json_store_file(object, sticker_->sticker_.get());
}
@@ -3625,7 +3630,7 @@ class Client::TdOnReturnFileCallback final : public TdQueryCallback {
CHECK(result->get_id() == td_api::file::ID);
auto file = move_object_as<td_api::file>(result);
- answer_query(JsonFile(file.get(), client_), std::move(query_));
+ answer_query(JsonFile(file.get(), client_, false), std::move(query_));
}
private:
@@ -8500,7 +8505,7 @@ void Client::on_file_download(int32 file_id, td::Result<object_ptr<td_api::file>
const auto &error = r_file.error();
fail_query_with_error(std::move(query), error.code(), error.public_message());
} else {
- answer_query(JsonFile(r_file.ok().get(), this), std::move(query));
+ answer_query(JsonFile(r_file.ok().get(), this, true), std::move(query));
}
}
}