Add ChatFullInfo.can_send_paid_media for channels.

This commit is contained in:
levlam 2024-06-30 13:33:06 +03:00
parent 546777ab24
commit 3e1fee6d7a
2 changed files with 5 additions and 0 deletions

View File

@ -1091,6 +1091,9 @@ class Client::JsonChat final : public td::Jsonable {
if (supergroup_info->location != nullptr) {
object("location", JsonChatLocation(supergroup_info->location.get()));
}
if (supergroup_info->has_paid_media_allowed && !supergroup_info->is_supergroup) {
object("can_send_paid_media", td::JsonTrue());
}
}
photo = supergroup_info->photo.get();
break;
@ -6952,6 +6955,7 @@ void Client::on_update(object_ptr<td_api::Object> result) {
supergroup_info->location = std::move(full_info->location_);
supergroup_info->has_hidden_members = full_info->has_hidden_members_;
supergroup_info->has_aggressive_anti_spam_enabled = full_info->has_aggressive_anti_spam_enabled_;
supergroup_info->has_paid_media_allowed = full_info->has_paid_media_allowed_;
break;
}
case td_api::updateOption::ID: {

View File

@ -878,6 +878,7 @@ class Client final : public WebhookActor::Callback {
bool join_by_request = false;
bool has_hidden_members = false;
bool has_aggressive_anti_spam_enabled = false;
bool has_paid_media_allowed = false;
};
static void add_supergroup(SupergroupInfo *supergroup_info, object_ptr<td_api::supergroup> &&supergroup);
SupergroupInfo *add_supergroup_info(int64 supergroup_id);