2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Add ability to reset cloud password in 7 days.

This commit is contained in:
John Preston
2021-07-30 14:32:49 +03:00
parent c100055fac
commit 256546071b
11 changed files with 299 additions and 30 deletions

View File

@@ -4764,6 +4764,23 @@ void ApiWrap::reloadPasswordState() {
}).send();
}
void ApiWrap::applyPendingReset(const MTPaccount_ResetPasswordResult &data) {
if (!_passwordState) {
reloadPasswordState();
return;
}
data.match([&](const MTPDaccount_resetPasswordOk &data) {
reloadPasswordState();
}, [&](const MTPDaccount_resetPasswordRequestedWait &data) {
const auto until = data.vuntil_date().v;
if (_passwordState->pendingResetDate != until) {
_passwordState->pendingResetDate = until;
_passwordStateChanges.fire_copy(*_passwordState);
}
}, [&](const MTPDaccount_resetPasswordFailedWait &data) {
});
}
void ApiWrap::clearUnconfirmedPassword() {
_passwordRequestId = request(MTPaccount_CancelPasswordEmail(
)).done([=](const MTPBool &result) {