Add Chat.has_restricted_voice_and_video_messages.

This commit is contained in:
levlam 2022-07-21 19:12:28 +03:00
parent e66c5fa67d
commit 9f3f32391c
2 changed files with 12 additions and 0 deletions

View File

@ -665,6 +665,9 @@ class Client::JsonChat final : public Jsonable {
if (user_info->has_private_forwards) { if (user_info->has_private_forwards) {
object("has_private_forwards", td::JsonTrue()); object("has_private_forwards", td::JsonTrue());
} }
if (user_info->has_restricted_voice_and_video_messages) {
object("has_restricted_voice_and_video_messages", td::JsonTrue());
}
} }
photo = user_info->photo.get(); photo = user_info->photo.get();
break; break;
@ -4728,6 +4731,8 @@ void Client::on_update(object_ptr<td_api::Object> result) {
set_user_bio(user_id, std::move(full_info->bio_->text_)); set_user_bio(user_id, std::move(full_info->bio_->text_));
} }
set_user_has_private_forwards(user_id, full_info->has_private_forwards_); set_user_has_private_forwards(user_id, full_info->has_private_forwards_);
set_user_has_restricted_voice_and_video_messages(user_id,
full_info->has_restricted_voice_and_video_note_messages_);
break; break;
} }
case td_api::updateBasicGroup::ID: { case td_api::updateBasicGroup::ID: {
@ -9119,6 +9124,11 @@ void Client::set_user_has_private_forwards(int64 user_id, bool has_private_forwa
add_user_info(user_id)->has_private_forwards = has_private_forwards; add_user_info(user_id)->has_private_forwards = has_private_forwards;
} }
void Client::set_user_has_restricted_voice_and_video_messages(int64 user_id,
bool has_restricted_voice_and_video_messages) {
add_user_info(user_id)->has_restricted_voice_and_video_messages = has_restricted_voice_and_video_messages;
}
void Client::add_group(GroupInfo *group_info, object_ptr<td_api::basicGroup> &&group) { void Client::add_group(GroupInfo *group_info, object_ptr<td_api::basicGroup> &&group) {
group_info->member_count = group->member_count_; group_info->member_count = group->member_count_;
group_info->left = group->status_->get_id() == td_api::chatMemberStatusLeft::ID; group_info->left = group->status_->get_id() == td_api::chatMemberStatusLeft::ID;

View File

@ -634,6 +634,7 @@ class Client final : public WebhookActor::Callback {
bool can_read_all_group_messages = false; bool can_read_all_group_messages = false;
bool is_inline_bot = false; bool is_inline_bot = false;
bool has_private_forwards = false; bool has_private_forwards = false;
bool has_restricted_voice_and_video_messages = false;
bool is_premium = false; bool is_premium = false;
bool added_to_attachment_menu = false; bool added_to_attachment_menu = false;
}; };
@ -641,6 +642,7 @@ class Client final : public WebhookActor::Callback {
void set_user_photo(int64 user_id, object_ptr<td_api::chatPhoto> &&photo); void set_user_photo(int64 user_id, object_ptr<td_api::chatPhoto> &&photo);
void set_user_bio(int64 user_id, td::string &&bio); void set_user_bio(int64 user_id, td::string &&bio);
void set_user_has_private_forwards(int64 user_id, bool has_private_forwards); void set_user_has_private_forwards(int64 user_id, bool has_private_forwards);
void set_user_has_restricted_voice_and_video_messages(int64 user_id, bool has_restricted_voice_and_video_messages);
UserInfo *add_user_info(int64 user_id); UserInfo *add_user_info(int64 user_id);
const UserInfo *get_user_info(int64 user_id) const; const UserInfo *get_user_info(int64 user_id) const;