Fix DialogParticipantStatus::get_effective_restricted_rights().
This commit is contained in:
parent
9cf1afe1b0
commit
2ad5a86fa7
@ -509,12 +509,12 @@ DialogParticipantStatus::DialogParticipantStatus(bool is_member,
|
|||||||
*this = DialogParticipantStatus(Type::Restricted, flags, until_date, string());
|
*this = DialogParticipantStatus(Type::Restricted, flags, until_date, string());
|
||||||
}
|
}
|
||||||
|
|
||||||
RestrictedRights DialogParticipantStatus::get_effective_restricted_rights(ChannelType channel_type) const {
|
RestrictedRights DialogParticipantStatus::get_effective_restricted_rights() const {
|
||||||
return RestrictedRights(can_send_messages(), can_send_audios(), can_send_documents(), can_send_photos(),
|
return RestrictedRights(can_send_messages(), can_send_audios(), can_send_documents(), can_send_photos(),
|
||||||
can_send_videos(), can_send_video_notes(), can_send_voice_notes(), can_send_stickers(),
|
can_send_videos(), can_send_video_notes(), can_send_voice_notes(), can_send_stickers(),
|
||||||
can_send_animations(), can_send_games(), can_use_inline_bots(), can_add_web_page_previews(),
|
can_send_animations(), can_send_games(), can_use_inline_bots(), can_add_web_page_previews(),
|
||||||
can_send_polls(), can_change_info_and_settings(), can_invite_users(), can_pin_messages(),
|
can_send_polls(), can_change_info_and_settings(), can_invite_users(), can_pin_messages(),
|
||||||
can_create_topics(), channel_type);
|
can_create_topics(), ChannelType::Unknown);
|
||||||
}
|
}
|
||||||
|
|
||||||
tl_object_ptr<td_api::ChatMemberStatus> DialogParticipantStatus::get_chat_member_status_object() const {
|
tl_object_ptr<td_api::ChatMemberStatus> DialogParticipantStatus::get_chat_member_status_object() const {
|
||||||
|
@ -372,7 +372,7 @@ class DialogParticipantStatus {
|
|||||||
return (get_administrator_rights().flags_ & flags) == flags;
|
return (get_administrator_rights().flags_ & flags) == flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
RestrictedRights get_effective_restricted_rights(ChannelType channel_type) const;
|
RestrictedRights get_effective_restricted_rights() const;
|
||||||
|
|
||||||
DialogParticipantStatus apply_restrictions(RestrictedRights default_restrictions, bool is_bot) const;
|
DialogParticipantStatus apply_restrictions(RestrictedRights default_restrictions, bool is_bot) const;
|
||||||
|
|
||||||
|
@ -3181,11 +3181,10 @@ Status can_send_message_content(DialogId dialog_id, const MessageContent *conten
|
|||||||
case DialogType::User:
|
case DialogType::User:
|
||||||
return td->contacts_manager_->get_user_default_permissions(dialog_id.get_user_id());
|
return td->contacts_manager_->get_user_default_permissions(dialog_id.get_user_id());
|
||||||
case DialogType::Chat:
|
case DialogType::Chat:
|
||||||
return td->contacts_manager_->get_chat_permissions(dialog_id.get_chat_id())
|
return td->contacts_manager_->get_chat_permissions(dialog_id.get_chat_id()).get_effective_restricted_rights();
|
||||||
.get_effective_restricted_rights(ChannelType::Unknown);
|
|
||||||
case DialogType::Channel:
|
case DialogType::Channel:
|
||||||
return td->contacts_manager_->get_channel_permissions(dialog_id.get_channel_id())
|
return td->contacts_manager_->get_channel_permissions(dialog_id.get_channel_id())
|
||||||
.get_effective_restricted_rights(td->contacts_manager_->get_channel_type(dialog_id.get_channel_id()));
|
.get_effective_restricted_rights();
|
||||||
case DialogType::SecretChat:
|
case DialogType::SecretChat:
|
||||||
return td->contacts_manager_->get_secret_chat_default_permissions(dialog_id.get_secret_chat_id());
|
return td->contacts_manager_->get_secret_chat_default_permissions(dialog_id.get_secret_chat_id());
|
||||||
case DialogType::None:
|
case DialogType::None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user