|
|
|
@ -2389,6 +2389,34 @@ class Client::JsonPollOptionAdded final : public td::Jsonable {
|
|
|
|
const Client *client_;
|
|
|
|
const Client *client_;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Client::JsonPollOptionDeleted final : public td::Jsonable {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
JsonPollOptionDeleted(const td_api::messagePollOptionDeleted *poll_option_deleted, int64 chat_id, bool need_reply,
|
|
|
|
|
|
|
|
const Client *client)
|
|
|
|
|
|
|
|
: poll_option_deleted_(poll_option_deleted), chat_id_(chat_id), need_reply_(need_reply), client_(client) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void store(td::JsonValueScope *scope) const {
|
|
|
|
|
|
|
|
auto object = scope->enter_object();
|
|
|
|
|
|
|
|
const MessageInfo *poll_message = client_->get_message(chat_id_, poll_option_deleted_->poll_message_id_, true);
|
|
|
|
|
|
|
|
if (poll_message != nullptr) {
|
|
|
|
|
|
|
|
object("poll_message", JsonMessage(poll_message, false, "poll option deleted", client_));
|
|
|
|
|
|
|
|
} else if (need_reply_) {
|
|
|
|
|
|
|
|
object("poll_message", JsonInaccessibleMessage(chat_id_, poll_option_deleted_->poll_message_id_, client_));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
object("option_persistent_id", poll_option_deleted_->option_id_);
|
|
|
|
|
|
|
|
object("option_text", poll_option_deleted_->text_->text_);
|
|
|
|
|
|
|
|
if (!poll_option_deleted_->text_->entities_.empty()) {
|
|
|
|
|
|
|
|
object("option_entities", JsonVectorEntities(poll_option_deleted_->text_->entities_, client_));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
const td_api::messagePollOptionDeleted *poll_option_deleted_;
|
|
|
|
|
|
|
|
int64 chat_id_;
|
|
|
|
|
|
|
|
bool need_reply_;
|
|
|
|
|
|
|
|
const Client *client_;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class Client::JsonChecklistTask final : public td::Jsonable {
|
|
|
|
class Client::JsonChecklistTask final : public td::Jsonable {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
JsonChecklistTask(const td_api::checklistTask *task, const Client *client) : task_(task), client_(client) {
|
|
|
|
JsonChecklistTask(const td_api::checklistTask *task, const Client *client) : task_(task), client_(client) {
|
|
|
|
@ -4537,8 +4565,11 @@ void Client::JsonMessage::store(td::JsonValueScope *scope) const {
|
|
|
|
object("poll_option_added", JsonPollOptionAdded(content, message_->chat_id, need_reply_, client_));
|
|
|
|
object("poll_option_added", JsonPollOptionAdded(content, message_->chat_id, need_reply_, client_));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case td_api::messagePollOptionDeleted::ID:
|
|
|
|
case td_api::messagePollOptionDeleted::ID: {
|
|
|
|
|
|
|
|
auto content = static_cast<const td_api::messagePollOptionDeleted *>(message_->content.get());
|
|
|
|
|
|
|
|
object("poll_option_deleted", JsonPollOptionDeleted(content, message_->chat_id, need_reply_, client_));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
case td_api::messageManagedBotCreated::ID:
|
|
|
|
case td_api::messageManagedBotCreated::ID:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
@ -16952,7 +16983,6 @@ bool Client::need_skip_update_message(int64 chat_id, const object_ptr<td_api::me
|
|
|
|
case td_api::messageUpgradedGiftPurchaseOfferRejected::ID:
|
|
|
|
case td_api::messageUpgradedGiftPurchaseOfferRejected::ID:
|
|
|
|
case td_api::messageChatHasProtectedContentToggled::ID:
|
|
|
|
case td_api::messageChatHasProtectedContentToggled::ID:
|
|
|
|
case td_api::messageChatHasProtectedContentDisableRequested::ID:
|
|
|
|
case td_api::messageChatHasProtectedContentDisableRequested::ID:
|
|
|
|
case td_api::messagePollOptionDeleted::ID:
|
|
|
|
|
|
|
|
case td_api::messageManagedBotCreated::ID:
|
|
|
|
case td_api::messageManagedBotCreated::ID:
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
|