2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +00:00

Remove Session::Exists() global access point.

This commit is contained in:
John Preston
2020-06-10 17:24:41 +04:00
parent 5f8d22f1f2
commit 598fb67cdf
19 changed files with 119 additions and 133 deletions

View File

@@ -120,9 +120,7 @@ Application::Application(not_null<Launcher*> launcher)
_mediaView->clearData();
}
if (session && !UpdaterDisabled()) {
if (const auto mtp = activeAccount().mtp()) {
UpdateChecker().setMtproto(mtp, session->userId());
}
UpdateChecker().setMtproto(session);
}
}, _lifetime);
@@ -580,6 +578,16 @@ bool Application::unreadBadgeMuted() const {
: false;
}
bool Application::offerLangPackSwitch() const {
// #TODO multi we offer only if we were upgraded from an old authed app.
return activeAccount().sessionExists();
}
bool Application::canApplyLangPackWithoutRestart() const {
// #TODO multi we can't if at least one account is authorized.
return !activeAccount().sessionExists();
}
void Application::setInternalLinkDomain(const QString &domain) const {
// This domain should start with 'http[s]://' and end with '/'.
// Like 'https://telegram.me/' or 'https://t.me/'.