Added stale media reupload guard before sending poll with expired files.

This commit is contained in:
23rd
2026-03-28 17:03:04 +03:00
parent c7ec23b872
commit 75632f7c86
9 changed files with 244 additions and 7 deletions
@@ -2268,9 +2268,13 @@ void PeerMenuCreatePoll(
state->create = nullptr;
weak->closeBox();
}),
crl::guard(weak, [=] {
crl::guard(weak, [=](bool fileReferenceExpired) {
state->lock = false;
weak->submitFailed(tr::lng_attach_failed(tr::now));
if (fileReferenceExpired) {
weak->submitMediaExpired();
} else {
weak->submitFailed(tr::lng_attach_failed(tr::now));
}
}));
};
box->submitRequests(