From 20a3629426b039bb0ddb74cef5ce375959d9e2fc Mon Sep 17 00:00:00 2001 From: Milen Pivchev Date: Mon, 9 Mar 2026 17:38:27 +0100 Subject: [PATCH] Add password option for email shares Signed-off-by: Milen Pivchev --- iOSClient/Share/Advanced/NCShareCells.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/iOSClient/Share/Advanced/NCShareCells.swift b/iOSClient/Share/Advanced/NCShareCells.swift index 8072025a3a..f7071219cb 100644 --- a/iOSClient/Share/Advanced/NCShareCells.swift +++ b/iOSClient/Share/Advanced/NCShareCells.swift @@ -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] } @@ -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 @@ -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 } }