feat(apple): send files to a remembered device

Adds the Send files action to the device detail, routing the picked
selection through sendToContact.

Rather than a second picker path, sharePickedFiles now takes a
ShareDestination, so the macOS security-scoped access handling covers both
routes. A contact destination carries no access policy, matching the core's
rule that an offer share is never public.
This commit is contained in:
2026-08-06 18:21:44 +02:00
parent dc23e87c56
commit 268fbf161d
11 changed files with 218 additions and 17 deletions

View File

@@ -59,15 +59,23 @@ struct IosFileSystemService: FileSystemService {
files: [PickedShareFile],
transferName: String,
senderName: String,
accessPolicy: ShareAccessPolicy
destination: ShareDestination
) async -> Result<Share, Error> {
guard !files.isEmpty else {
return .failure(InvitationError.shareEmpty)
}
let sources = files.map { $0.toIosShareSource() }
return await repository.shareSources(
sources, transferName: transferName, senderName: senderName, accessPolicy: accessPolicy
)
switch destination {
case .invitation(let accessPolicy):
return await repository.shareSources(
sources, transferName: transferName, senderName: senderName, accessPolicy: accessPolicy
)
case .contact(let endpointId):
return await repository.sendToContact(
endpointId: endpointId, sources: sources,
transferName: transferName, senderName: senderName
)
}
}
private func validateSecurityScopedUrl(_ value: String) -> FolderAccessStatus {