diff --git a/src/gui/filedetails/sharemodel.cpp b/src/gui/filedetails/sharemodel.cpp index f6564887c4..aa406cdd05 100644 --- a/src/gui/filedetails/sharemodel.cpp +++ b/src/gui/filedetails/sharemodel.cpp @@ -1014,20 +1014,23 @@ bool ShareModel::accountConnected() const return _accountState && _accountState->isConnected(); } -bool ShareModel::sharingEnabled() const +bool ShareModel::validCapabilities() const { return _accountState && _accountState->account() && - _accountState->account()->capabilities().isValid() && + _accountState->account()->capabilities().isValid(); +} + +bool ShareModel::sharingEnabled() const +{ + return validCapabilities() && _accountState->account()->capabilities().shareAPI(); } bool ShareModel::publicLinkSharesEnabled() const { return Theme::instance()->linkSharing() && - _accountState && - _accountState->account() && - _accountState->account()->capabilities().isValid() && + validCapabilities() && _accountState->account()->capabilities().sharePublicLink(); } diff --git a/src/gui/filedetails/sharemodel.h b/src/gui/filedetails/sharemodel.h index 4e11985347..ffd0d318db 100644 --- a/src/gui/filedetails/sharemodel.h +++ b/src/gui/filedetails/sharemodel.h @@ -182,6 +182,7 @@ private: [[nodiscard]] QString avatarUrlForShare(const SharePtr &share) const; [[nodiscard]] long long enforcedMaxExpireDateForShare(const SharePtr &share) const; [[nodiscard]] bool expireDateEnforcedForShare(const SharePtr &share) const; + [[nodiscard]] bool validCapabilities() const; bool _fetchOngoing = false; bool _hasInitialShareFetchCompleted = false;