mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
@@ -37,8 +37,10 @@ constexpr auto kLegacyCallsPeerToPeerNobody = 4;
|
||||
|
||||
Session::Session(
|
||||
not_null<Main::Account*> account,
|
||||
const MTPUser &user)
|
||||
const MTPUser &user,
|
||||
Settings &&settings)
|
||||
: _account(account)
|
||||
, _settings(std::move(settings))
|
||||
, _saveSettingsTimer([=] { Local::writeUserSettings(); })
|
||||
, _autoLockTimer([=] { checkAutoLock(); })
|
||||
, _api(std::make_unique<ApiWrap>(this))
|
||||
@@ -84,6 +86,15 @@ Session::Session(
|
||||
Local::writeSelf();
|
||||
}
|
||||
}));
|
||||
|
||||
if (_settings.hadLegacyCallsPeerToPeerNobody()) {
|
||||
api().savePrivacy(
|
||||
MTP_inputPrivacyKeyPhoneP2P(),
|
||||
QVector<MTPInputPrivacyRule>(
|
||||
1,
|
||||
MTP_inputPrivacyValueDisallowAll()));
|
||||
saveSettingsDelayed();
|
||||
}
|
||||
});
|
||||
|
||||
Window::Theme::Background()->start();
|
||||
@@ -127,18 +138,6 @@ bool Session::validateSelf(const MTPUser &user) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void Session::moveSettingsFrom(Settings &&other) {
|
||||
_settings.moveFrom(std::move(other));
|
||||
if (_settings.hadLegacyCallsPeerToPeerNobody()) {
|
||||
api().savePrivacy(
|
||||
MTP_inputPrivacyKeyPhoneP2P(),
|
||||
QVector<MTPInputPrivacyRule>(
|
||||
1,
|
||||
MTP_inputPrivacyValueDisallowAll()));
|
||||
saveSettingsDelayed();
|
||||
}
|
||||
}
|
||||
|
||||
void Session::saveSettingsDelayed(crl::time delay) {
|
||||
Expects(this == &Auth());
|
||||
|
||||
|
Reference in New Issue
Block a user