mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-04-01 00:08:02 +00:00
Always pass all users to add group member box.
This commit is contained in:
parent
90f5f7dded
commit
a403ad7d37
@ -332,17 +332,22 @@ void Members::updateHeaderControlsGeometry(int newWidth) {
|
||||
}
|
||||
|
||||
void Members::addMember() {
|
||||
if (auto chat = _peer->asChat()) {
|
||||
if (const auto chat = _peer->asChat()) {
|
||||
if (chat->count >= Global::ChatSizeMax() && chat->amCreator()) {
|
||||
Ui::show(Box<ConvertToSupergroupBox>(chat));
|
||||
} else {
|
||||
AddParticipantsBoxController::Start(chat);
|
||||
}
|
||||
} else if (auto channel = _peer->asChannel()) {
|
||||
if (channel->mgInfo) {
|
||||
auto &participants = channel->mgInfo->lastParticipants;
|
||||
AddParticipantsBoxController::Start(channel, { participants.cbegin(), participants.cend() });
|
||||
}
|
||||
} else if (const auto channel = _peer->asChannel()) {
|
||||
const auto state = _listController->saveState();
|
||||
const auto users = ranges::view::all(
|
||||
state->list
|
||||
) | ranges::view::transform([](not_null<PeerData*> peer) {
|
||||
return peer->asUser();
|
||||
});
|
||||
AddParticipantsBoxController::Start(
|
||||
channel,
|
||||
{ users.begin(), users.end() });
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -496,13 +496,8 @@ void ShowForwardMessagesBox(
|
||||
}
|
||||
|
||||
void PeerMenuAddChannelMembers(not_null<ChannelData*> channel) {
|
||||
if (channel->isMegagroup()) {
|
||||
auto &participants = channel->mgInfo->lastParticipants;
|
||||
AddParticipantsBoxController::Start(
|
||||
channel,
|
||||
{ participants.cbegin(), participants.cend() });
|
||||
return;
|
||||
} else if (channel->membersCount() >= Global::ChatSizeMax()) {
|
||||
if (!channel->isMegagroup()
|
||||
&& channel->membersCount() >= Global::ChatSizeMax()) {
|
||||
Ui::show(
|
||||
Box<MaxInviteBox>(channel),
|
||||
LayerOption::KeepOther);
|
||||
|
Loading…
Reference in New Issue
Block a user