Skip to content

Commit 6533fee

Browse files
Merge pull request #3547 from nextcloud/6.6.5-download-limit-capability-checks
Fix: Check for Download Limit Capability on Share Updates
2 parents 82bc44b + 3100f33 commit 6533fee

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

iOSClient/Share/NCShareNetworking.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class NCShareNetworking: NSObject {
117117
self.updateShare(template, downloadLimit: downloadLimit)
118118
// Download limit update should happen implicitly on share update.
119119
} else {
120-
if case let .limited(limit, _) = downloadLimit {
120+
if case let .limited(limit, _) = downloadLimit, NCCapabilities.shared.getCapabilities(account: self.metadata.account).capabilityFileSharingDownloadLimit {
121121
self.setShareDownloadLimit(limit, token: share.token)
122122
}
123123
}
@@ -157,10 +157,12 @@ class NCShareNetworking: NSObject {
157157
self.database.addShare(account: self.metadata.account, home: home, shares: [share])
158158
self.delegate?.readShareCompleted()
159159

160-
if case let .limited(limit, _) = downloadLimit {
161-
self.setShareDownloadLimit(limit, token: share.token)
162-
} else {
163-
self.removeShareDownloadLimit(token: share.token)
160+
if NCCapabilities.shared.getCapabilities(account: self.metadata.account).capabilityFileSharingDownloadLimit {
161+
if case let .limited(limit, _) = downloadLimit {
162+
self.setShareDownloadLimit(limit, token: share.token)
163+
} else {
164+
self.removeShareDownloadLimit(token: share.token)
165+
}
164166
}
165167

166168
NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterUpdateShare, userInfo: ["account": self.metadata.account, "serverUrl": self.metadata.serverUrl])

0 commit comments

Comments
 (0)