mirror of
https://github.com/PaiGramTeam/telegram-bot-api.git
synced 2024-11-16 04:35:33 +00:00
Add Message.users_shared field.
This commit is contained in:
parent
0fbcfa7eba
commit
ee59941ca3
@ -1964,6 +1964,20 @@ class Client::JsonUserShared final : public td::Jsonable {
|
|||||||
const td_api::messageUsersShared *users_shared_;
|
const td_api::messageUsersShared *users_shared_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Client::JsonUsersShared final : public td::Jsonable {
|
||||||
|
public:
|
||||||
|
explicit JsonUsersShared(const td_api::messageUsersShared *users_shared) : users_shared_(users_shared) {
|
||||||
|
}
|
||||||
|
void store(td::JsonValueScope *scope) const {
|
||||||
|
auto object = scope->enter_object();
|
||||||
|
object("user_ids", td::json_array(users_shared_->user_ids_, [](int64 user_id) { return user_id; }));
|
||||||
|
object("request_id", users_shared_->button_id_);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
const td_api::messageUsersShared *users_shared_;
|
||||||
|
};
|
||||||
|
|
||||||
class Client::JsonChatShared final : public td::Jsonable {
|
class Client::JsonChatShared final : public td::Jsonable {
|
||||||
public:
|
public:
|
||||||
explicit JsonChatShared(const td_api::messageChatShared *chat_shared) : chat_shared_(chat_shared) {
|
explicit JsonChatShared(const td_api::messageChatShared *chat_shared) : chat_shared_(chat_shared) {
|
||||||
@ -2762,7 +2776,10 @@ void Client::JsonMessage::store(td::JsonValueScope *scope) const {
|
|||||||
}
|
}
|
||||||
case td_api::messageUsersShared::ID: {
|
case td_api::messageUsersShared::ID: {
|
||||||
auto content = static_cast<const td_api::messageUsersShared *>(message_->content.get());
|
auto content = static_cast<const td_api::messageUsersShared *>(message_->content.get());
|
||||||
object("user_shared", JsonUserShared(content));
|
if (content->user_ids_.size() == 1) {
|
||||||
|
object("user_shared", JsonUserShared(content));
|
||||||
|
}
|
||||||
|
object("users_shared", JsonUsersShared(content));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case td_api::messageChatShared::ID: {
|
case td_api::messageChatShared::ID: {
|
||||||
|
@ -177,6 +177,7 @@ class Client final : public WebhookActor::Callback {
|
|||||||
class JsonChatSetMessageAutoDeleteTime;
|
class JsonChatSetMessageAutoDeleteTime;
|
||||||
class JsonWriteAccessAllowed;
|
class JsonWriteAccessAllowed;
|
||||||
class JsonUserShared;
|
class JsonUserShared;
|
||||||
|
class JsonUsersShared;
|
||||||
class JsonChatShared;
|
class JsonChatShared;
|
||||||
class JsonGiveaway;
|
class JsonGiveaway;
|
||||||
class JsonGiveawayWinners;
|
class JsonGiveawayWinners;
|
||||||
|
Loading…
Reference in New Issue
Block a user