Added support of pending suggestion to set up login email.
This commit is contained in:
@@ -169,6 +169,7 @@ Application::Application()
|
||||
, _langCloudManager(std::make_unique<Lang::CloudManager>(langpack()))
|
||||
, _emojiKeywords(std::make_unique<ChatHelpers::EmojiKeywords>())
|
||||
, _tray(std::make_unique<Tray>())
|
||||
, _setupEmailLock(false)
|
||||
, _autoLockTimer([=] { checkAutoLock(); }) {
|
||||
Ui::Integration::Set(&_private->uiIntegration);
|
||||
|
||||
@@ -1245,6 +1246,20 @@ rpl::producer<bool> Application::passcodeLockValue() const {
|
||||
return _passcodeLock.value();
|
||||
}
|
||||
|
||||
void Application::lockBySetupEmail() {
|
||||
_setupEmailLock = true;
|
||||
enumerateWindows([&](not_null<Window::Controller*> w) {
|
||||
w->setupSetupEmailLock();
|
||||
});
|
||||
}
|
||||
|
||||
void Application::unlockSetupEmail() {
|
||||
_setupEmailLock = false;
|
||||
enumerateWindows([&](not_null<Window::Controller*> w) {
|
||||
w->clearSetupEmailLock();
|
||||
});
|
||||
}
|
||||
|
||||
bool Application::someSessionExists() const {
|
||||
for (const auto &[index, account] : _domain->accounts()) {
|
||||
if (account->sessionExists()) {
|
||||
|
||||
@@ -304,6 +304,9 @@ public:
|
||||
rpl::producer<bool> passcodeLockChanges() const;
|
||||
rpl::producer<bool> passcodeLockValue() const;
|
||||
|
||||
void lockBySetupEmail();
|
||||
void unlockSetupEmail();
|
||||
|
||||
void checkAutoLock(crl::time lastNonIdleTime = 0);
|
||||
void checkAutoLockIn(crl::time time);
|
||||
void localPasscodeChanged();
|
||||
@@ -444,6 +447,7 @@ private:
|
||||
bool _floatPlayerGifsPaused = false;
|
||||
|
||||
rpl::variable<bool> _passcodeLock;
|
||||
rpl::variable<bool> _setupEmailLock;
|
||||
bool _screenIsLocked = false;
|
||||
|
||||
crl::time _shouldLockAt = 0;
|
||||
|
||||
@@ -315,8 +315,8 @@ CloudPasswordState ParseCloudPasswordState(
|
||||
ParseSecureSecretAlgo(data.vnew_secure_algo()));
|
||||
result.unconfirmedPattern = qs(
|
||||
data.vemail_unconfirmed_pattern().value_or_empty());
|
||||
result.loginEmailPattern = qs(
|
||||
data.vlogin_email_pattern().value_or_empty());
|
||||
const auto pattern = qs(data.vlogin_email_pattern().value_or_empty());
|
||||
result.loginEmailPattern = pattern.contains(' ') ? QString() : pattern;
|
||||
result.pendingResetDate = data.vpending_reset_date().value_or_empty();
|
||||
|
||||
result.outdatedClient = [&] {
|
||||
|
||||
Reference in New Issue
Block a user