mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 04:55:48 +03:00
Save serverHasValidsubcription in the account.
Signed-off-by: Camila Ayres <hello@camilasan.com>
This commit is contained in:
parent
664a13189b
commit
d0f87c3496
3 changed files with 24 additions and 4 deletions
|
@ -338,7 +338,7 @@ void AccountManager::saveAccountHelper(Account *acc, QSettings &settings, bool s
|
|||
settings.setValue(QLatin1String(serverVersionC), acc->_serverVersion);
|
||||
settings.setValue(QLatin1String(serverColorC), acc->_serverColor);
|
||||
settings.setValue(QLatin1String(serverTextColorC), acc->_serverTextColor);
|
||||
settings.setValue(QLatin1String(serverHasValidSubscriptionC), acc->capabilities().serverHasValidSubscription());
|
||||
settings.setValue(QLatin1String(serverHasValidSubscriptionC), acc->serverHasValidSubscription());
|
||||
|
||||
if (!acc->_skipE2eeMetadataChecksumValidation) {
|
||||
settings.remove(QLatin1String(skipE2eeMetadataChecksumValidationC));
|
||||
|
|
|
@ -1076,13 +1076,28 @@ void Account::setAskUserForMnemonic(const bool ask)
|
|||
emit askUserForMnemonicChanged();
|
||||
}
|
||||
|
||||
bool Account::serverHasValidSubscription() const
|
||||
{
|
||||
return _serverHasValidSubscription;
|
||||
}
|
||||
|
||||
void Account::setServerHasValidSubscription(bool valid)
|
||||
{
|
||||
if (_serverHasValidSubscription != valid) {
|
||||
_serverHasValidSubscription = valid;
|
||||
}
|
||||
}
|
||||
|
||||
void Account::updateServerSubcription()
|
||||
{
|
||||
ConfigFile currentConfig;
|
||||
if (const auto serverHasValidSubscription = _capabilities.serverHasValidSubscription();
|
||||
serverHasValidSubscription != currentConfig.serverHasValidSubscription() && !serverHasValidSubscription) {
|
||||
currentConfig.setServerHasValidSubscription(serverHasValidSubscription);
|
||||
const auto capabilityValidSubscription = _capabilities.serverHasValidSubscription();
|
||||
const auto configValidSubscription = currentConfig.serverHasValidSubscription();
|
||||
if (capabilityValidSubscription != configValidSubscription && !configValidSubscription) {
|
||||
currentConfig.setServerHasValidSubscription(capabilityValidSubscription);
|
||||
}
|
||||
|
||||
setServerHasValidSubscription(capabilityValidSubscription);
|
||||
}
|
||||
|
||||
void Account::updateDesktopEnterpriseChannel()
|
||||
|
|
|
@ -409,6 +409,9 @@ public:
|
|||
[[nodiscard]] unsigned int downloadLimit() const;
|
||||
void setDownloadLimit(unsigned int kbytes);
|
||||
|
||||
[[nodiscard]] bool serverHasValidSubscription() const;
|
||||
void setServerHasValidSubscription(bool valid);
|
||||
|
||||
public slots:
|
||||
/// Used when forgetting credentials
|
||||
void clearQNAMCache();
|
||||
|
@ -553,6 +556,8 @@ private:
|
|||
unsigned int _uploadLimit = 0;
|
||||
unsigned int _downloadLimit = 0;
|
||||
|
||||
bool _serverHasValidSubscription = false;
|
||||
|
||||
/* IMPORTANT - remove later - FIXME MS@2019-12-07 -->
|
||||
* TODO: For "Log out" & "Remove account": Remove client CA certs and KEY!
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue