diff options
author | Christian Kamm <mail@ckamm.de> | 2019-03-06 14:59:27 +0300 |
---|---|---|
committer | Christian Kamm <mail@ckamm.de> | 2019-03-07 12:16:07 +0300 |
commit | f3ab5843041ef3a15ddfb7582a242ab305c0b38a (patch) | |
tree | 5dc803e3c001fc7d4905e955a1008439e7fcfab7 /src/libsync | |
parent | a39f4a532f102e9cc60039108124ce1f572f15cb (diff) |
Shares: "copy link" action can create shares with expiry #7061
Previously it gave up if "expiry required" was enabled. Now it'll create
a link share per day with the default expiry for these setups.
Diffstat (limited to 'src/libsync')
-rw-r--r-- | src/libsync/capabilities.cpp | 11 | ||||
-rw-r--r-- | src/libsync/capabilities.h | 3 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/libsync/capabilities.cpp b/src/libsync/capabilities.cpp index 08c1e45ff..10d46573c 100644 --- a/src/libsync/capabilities.cpp +++ b/src/libsync/capabilities.cpp @@ -60,16 +60,21 @@ bool Capabilities::sharePublicLinkEnforcePassword() const return _capabilities["files_sharing"].toMap()["public"].toMap()["password"].toMap()["enforced"].toBool(); } -bool Capabilities::sharePublicLinkEnforceExpireDate() const +bool Capabilities::sharePublicLinkDefaultExpire() const { - return _capabilities["files_sharing"].toMap()["public"].toMap()["expire_date"].toMap()["enforced"].toBool(); + return _capabilities["files_sharing"].toMap()["public"].toMap()["expire_date"].toMap()["enabled"].toBool(); } -int Capabilities::sharePublicLinkExpireDateDays() const +int Capabilities::sharePublicLinkDefaultExpireDateDays() const { return _capabilities["files_sharing"].toMap()["public"].toMap()["expire_date"].toMap()["days"].toInt(); } +bool Capabilities::sharePublicLinkEnforceExpireDate() const +{ + return _capabilities["files_sharing"].toMap()["public"].toMap()["expire_date"].toMap()["enforced"].toBool(); +} + bool Capabilities::sharePublicLinkMultiple() const { return _capabilities["files_sharing"].toMap()["public"].toMap()["multiple"].toBool(); diff --git a/src/libsync/capabilities.h b/src/libsync/capabilities.h index 63a59d6c0..3a073e180 100644 --- a/src/libsync/capabilities.h +++ b/src/libsync/capabilities.h @@ -38,8 +38,9 @@ public: bool sharePublicLinkAllowUpload() const; bool sharePublicLinkSupportsUploadOnly() const; bool sharePublicLinkEnforcePassword() const; + bool sharePublicLinkDefaultExpire() const; + int sharePublicLinkDefaultExpireDateDays() const; bool sharePublicLinkEnforceExpireDate() const; - int sharePublicLinkExpireDateDays() const; bool sharePublicLinkMultiple() const; bool shareResharing() const; bool chunkingNg() const; |