Skip to content

Commit dd621e3

Browse files
committed
Add confirmation message for banning too many users at once
1 parent fbd8621 commit dd621e3

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

Telegram/Resources/langs/lang.strings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2618,6 +2618,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
26182618
"lng_group_requests_none_channel" = "There are no pending join requests.";
26192619
"lng_group_requests_dismiss_all_confirm" = "Are you sure you want to dismiss all pending join requests?";
26202620
"lng_group_requests_ban_all_confirm" = "Are you sure you want to ban all users who requested to join?";
2621+
"lng_group_requests_ban_too_much_users" = "You cannot ban so many users at once. Try dismissing them instead.";
26212622

26222623
"lng_channel_public_link_copied" = "Link copied to clipboard.";
26232624
"lng_context_about_private_link" = "This link will only work for members of this chat.";

Telegram/SourceFiles/boxes/peers/edit_peer_requests_box.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,14 @@ void RequestsBoxController::banAllRequests() {
484484
return;
485485
}
486486

487+
if (count >= 20) {
488+
delegate()->peerListUiShow()->showBox(Ui::MakeConfirmBox({
489+
.text = tr::lng_group_requests_ban_too_much_users(tr::now),
490+
.inform = true
491+
}));
492+
return;
493+
}
494+
487495
const auto guard = base::make_weak(this);
488496
delegate()->peerListUiShow()->showBox(Ui::MakeConfirmBox({
489497
.text = tr::lng_group_requests_ban_all_confirm(tr::now),

0 commit comments

Comments
 (0)