Don't add self speculatively to channel members if join requests are enabled in the chat.

This commit is contained in:
levlam 2022-09-21 19:04:36 +03:00
parent 6c91b9aa6b
commit 2a41ab0562

View File

@ -7243,7 +7243,9 @@ void ContactsManager::add_channel_participant(ChannelId channel_id, UserId user_
return promise.set_error(Status::Error(400, "Can't return to kicked from chat"));
}
speculative_add_channel_user(channel_id, user_id, DialogParticipantStatus::Member(), c->status);
if (!get_channel_join_request(c)) {
speculative_add_channel_user(channel_id, user_id, DialogParticipantStatus::Member(), c->status);
}
td_->create_handler<JoinChannelQuery>(std::move(promise))->send(channel_id);
return;
}