mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Create keys not simultaneously.
This commit is contained in:
parent
e6d3b2b098
commit
f424cb54f7
1 changed files with 6 additions and 6 deletions
|
@ -183,9 +183,10 @@ DcKeyCreator::DcKeyCreator(
|
||||||
answered();
|
answered();
|
||||||
});
|
});
|
||||||
|
|
||||||
pqSend(&_temporary, _request.temporaryExpiresIn);
|
|
||||||
if (_request.persistentNeeded) {
|
if (_request.persistentNeeded) {
|
||||||
pqSend(&_persistent, 0);
|
pqSend(&_persistent, 0);
|
||||||
|
} else {
|
||||||
|
pqSend(&_temporary, _request.temporaryExpiresIn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -602,13 +603,12 @@ void DcKeyCreator::failed(Error error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DcKeyCreator::done() {
|
void DcKeyCreator::done() {
|
||||||
Expects(_temporary.stage != Stage::None);
|
if (_temporary.stage == Stage::None) {
|
||||||
|
pqSend(&_temporary, _request.temporaryExpiresIn);
|
||||||
if (_persistent.stage != Stage::None && _persistent.stage != Stage::Ready) {
|
|
||||||
return;
|
|
||||||
} else if (_temporary.stage != Stage::Ready) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Assert(_temporary.stage == Stage::Ready);
|
||||||
|
Assert(_persistent.stage == Stage::Ready || _persistent.stage == Stage::None);
|
||||||
|
|
||||||
auto result = Result();
|
auto result = Result();
|
||||||
result.temporaryKey = std::make_shared<AuthKey>(
|
result.temporaryKey = std::make_shared<AuthKey>(
|
||||||
|
|
Loading…
Add table
Reference in a new issue