2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Support new limit boxes for shareable folders.

This commit is contained in:
John Preston
2023-04-03 17:42:01 +04:00
parent 77939ae9bd
commit 9b1c5b1050
10 changed files with 160 additions and 16 deletions

View File

@@ -104,7 +104,6 @@ struct FilterRow {
not_null<FilterRowButton*> button;
Data::ChatFilter filter;
bool removed = false;
bool removeHasLinks = false;
mtpRequestId removePeersRequestId = 0;
std::vector<not_null<PeerData*>> suggestRemovePeers;
std::vector<not_null<PeerData*>> removePeers;
@@ -399,7 +398,7 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
const auto row = find(button);
if (row->removed || row->removePeersRequestId > 0) {
return;
} else if (row->filter.chatlist() && row->removeHasLinks) {
} else if (row->filter.hasMyLinks()) {
controller->show(Ui::MakeConfirmBox({
.text = { tr::lng_filters_delete_sure(tr::now) },
.confirmed = crl::guard(button, [=](Fn<void()> close) {
@@ -430,12 +429,10 @@ void FilterRowButton::paintEvent(QPaintEvent *e) {
) | ranges::views::transform([=](const MTPPeer &peer) {
return session->data().peer(peerFromMTP(peer));
}) | ranges::to_vector;
row->removeHasLinks = true; // #TODO filters
markForRemoval(button);
})).fail(crl::guard(button, [=] {
const auto row = find(button);
row->removePeersRequestId = -1;
row->removeHasLinks = false;
markForRemoval(button);
})).send();
} else {