2
0
mirror of https://github.com/tdlib/telegram-bot-api synced 2025-08-22 18:08:31 +00:00

Add Message.suggested_post_declined.

This commit is contained in:
levlam 2025-08-02 23:29:25 +03:00
parent 1362356cea
commit 481791f4bd
2 changed files with 30 additions and 3 deletions

View File

@ -2244,6 +2244,31 @@ class Client::JsonSuggestedPostApproved final : public td::Jsonable {
const Client *client_;
};
class Client::JsonSuggestedPostDeclined final : public td::Jsonable {
public:
JsonSuggestedPostDeclined(const td_api::messageSuggestedPostDeclined *suggested_post_declined, int64 chat_id,
const Client *client)
: suggested_post_declined_(suggested_post_declined), chat_id_(chat_id), client_(client) {
}
void store(td::JsonValueScope *scope) const {
auto object = scope->enter_object();
const MessageInfo *suggested_post_message =
client_->get_message(chat_id_, suggested_post_declined_->suggested_post_message_id_, true);
if (suggested_post_message != nullptr) {
object("suggested_post_message",
JsonMessage(suggested_post_message, false, "suggested post approval added", client_));
}
if (!suggested_post_declined_->comment_.empty()) {
object("comment", suggested_post_declined_->comment_);
}
}
private:
const td_api::messageSuggestedPostDeclined *suggested_post_declined_;
int64 chat_id_;
const Client *client_;
};
class Client::JsonStory final : public td::Jsonable {
public:
JsonStory(int64 chat_id, int32 story_id, const Client *client)
@ -3984,8 +4009,11 @@ void Client::JsonMessage::store(td::JsonValueScope *scope) const {
object("suggested_post_approved", JsonSuggestedPostApproved(content, message_->chat_id, client_));
break;
}
case td_api::messageSuggestedPostDeclined::ID:
case td_api::messageSuggestedPostDeclined::ID: {
auto content = static_cast<const td_api::messageSuggestedPostDeclined *>(message_->content.get());
object("suggested_post_declined", JsonSuggestedPostDeclined(content, message_->chat_id, client_));
break;
}
case td_api::messageSuggestedPostPaid::ID:
break;
case td_api::messageSuggestedPostRefunded::ID:
@ -15938,8 +15966,6 @@ bool Client::need_skip_update_message(int64 chat_id, const object_ptr<td_api::me
return true;
case td_api::messageGiftedTon::ID:
return true;
case td_api::messageSuggestedPostDeclined::ID:
return true;
case td_api::messageSuggestedPostPaid::ID:
return true;
case td_api::messageSuggestedPostRefunded::ID:

View File

@ -139,6 +139,7 @@ class Client final : public WebhookActor::Callback {
class JsonChecklistTasksAdded;
class JsonSuggestedPostApprovalFailed;
class JsonSuggestedPostApproved;
class JsonSuggestedPostDeclined;
class JsonEntity;
class JsonVectorEntities;
class JsonWebAppInfo;