Allow bots to restrict left chat members without trying to add them.

GitOrigin-RevId: b2884da3cdc524634b23d1d149bdb66bc6fa206d
This commit is contained in:
levlam 2019-06-20 20:34:08 +03:00
parent fa11870016
commit e23ecdf572

View File

@ -4390,6 +4390,10 @@ void ContactsManager::change_channel_participant_status_impl(ChannelId channel_i
DialogParticipantStatus status,
DialogParticipantStatus old_status,
Promise<Unit> &&promise) {
if (td_->auth_manager_->is_bot() && status.is_restricted() && status.is_member() && !old_status.is_member()) {
// allow bots to restrict left chat members without trying to add them
status.set_is_member(false);
}
if (old_status == status) {
return promise.set_value(Unit());
}