Added ability to set TTL on creation groups.

This commit is contained in:
23rd
2022-11-30 13:06:17 +03:00
parent 11165abc09
commit 1cd4cb3baa
6 changed files with 67 additions and 17 deletions
@@ -68,7 +68,9 @@ Args TTLValidator::createArgs() const {
mtpRequestId savingRequestId = 0;
};
const auto state = std::make_shared<State>();
auto callback = [=, toastParent = show->toastParent()](TimeId period) {
auto callback = [=, toastParent = show->toastParent()](
TimeId period,
Fn<void()>) {
auto &api = peer->session().api();
if (state->savingRequestId) {
if (period == state->savingPeriod) {
@@ -84,11 +86,6 @@ Args TTLValidator::createArgs() const {
peer->session().api().applyUpdates(result);
ShowAutoDeleteToast(toastParent, peer);
state->savingRequestId = 0;
#if 0
if (const auto strong = state->weak.data()) {
strong->closeBox();
}
#endif
}).fail([=] {
state->savingRequestId = 0;
}).send();