diff options
Diffstat (limited to 'core/src/files/client.js')
-rw-r--r-- | core/src/files/client.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/core/src/files/client.js b/core/src/files/client.js index 630e9fb98ad..2c71fbe46e1 100644 --- a/core/src/files/client.js +++ b/core/src/files/client.js @@ -104,6 +104,7 @@ import escapeHTML from 'escape-html' Client.PROPERTY_GETCONTENTLENGTH = '{' + Client.NS_DAV + '}getcontentlength' Client.PROPERTY_ISENCRYPTED = '{' + Client.NS_DAV + '}is-encrypted' Client.PROPERTY_SHARE_PERMISSIONS = '{' + Client.NS_OCS + '}share-permissions' + Client.PROPERTY_SHARE_ATTRIBUTES = '{' + Client.NS_NEXTCLOUD + '}share-attributes' Client.PROPERTY_QUOTA_AVAILABLE_BYTES = '{' + Client.NS_DAV + '}quota-available-bytes' Client.PROTOCOL_HTTP = 'http' @@ -160,6 +161,10 @@ import escapeHTML from 'escape-html' * Share permissions */ [Client.NS_OCS, 'share-permissions'], + /** + * Share attributes + */ + [Client.NS_NEXTCLOUD, 'share-attributes'], ] /** @@ -416,6 +421,18 @@ import escapeHTML from 'escape-html' data.sharePermissions = parseInt(sharePermissionsProp) } + const shareAttributesProp = props[Client.PROPERTY_SHARE_ATTRIBUTES] + if (!_.isUndefined(shareAttributesProp)) { + try { + data.shareAttributes = JSON.parse(shareAttributesProp) + } catch (e) { + console.warn('Could not parse share attributes returned by server: "' + shareAttributesProp + '"') + data.shareAttributes = []; + } + } else { + data.shareAttributes = []; + } + const mounTypeProp = props['{' + Client.NS_NEXTCLOUD + '}mount-type'] if (!_.isUndefined(mounTypeProp)) { data.mountType = mounTypeProp |