Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions iOSClient/Share/Advanced/NCShareCells.swift
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ enum NCAdvancedPermission: CaseIterable, NCShareCellConfig {
}

case label, hideDownload, limitDownload, expirationDate, password, note, downloadAndSync

static let forLink: [NCAdvancedPermission] = [.expirationDate, .hideDownload, .label, .limitDownload, .note, .password]
static let forEmail: [NCAdvancedPermission] = [.expirationDate, .note, .downloadAndSync, .password]
static let forUser: [NCAdvancedPermission] = [.expirationDate, .note, .downloadAndSync]
}

Expand All @@ -226,7 +228,8 @@ struct NCShareConfig {
let type: NCPermission.Type = (share.shareType == NKShare.ShareType.publicLink.rawValue || share.shareType == NKShare.ShareType.email.rawValue) ? NCLinkEmailPermission.self : NCUserPermission.self
self.permissions = parentMetadata.directory ? (parentMetadata.e2eEncrypted ? type.forDirectoryE2EE(account: parentMetadata.account) : type.forDirectory) : type.forFile

if share.shareType == NKShare.ShareType.publicLink.rawValue {
switch share.shareType {
case NKShare.ShareType.publicLink.rawValue:
let capabilities = NCNetworking.shared.capabilities[parentMetadata.account] ?? NKCapabilities.Capabilities()
let hasDownloadLimitCapability = capabilities.fileSharingDownloadLimit

Expand All @@ -235,7 +238,9 @@ struct NCShareConfig {
} else {
self.advanced = NCAdvancedPermission.forLink
}
} else {
case NKShare.ShareType.email.rawValue:
self.advanced = NCAdvancedPermission.forEmail
default:
self.advanced = NCAdvancedPermission.forUser
}
}
Expand Down
Loading