Add detection of unsupported file type

This commit is contained in:
Leon Böttger committed 2025-05-17 13:28:36 +02:00
1 parent e7654313f3
commit 6b883e9457
20 files changed
+47 -3

No files matched your search

+10 -2
View File
@@ -369,12 +369,20 @@ class InboundNearbyConnection: NearbyConnection {
}
}
else {
rejectTransfer(with: .unsupportedAttachmentType)
rejectDueToUnsupportedFileType(frame)
}
} else {
rejectTransfer(with: .unsupportedAttachmentType)
rejectDueToUnsupportedFileType(frame)
}
}
func rejectDueToUnsupportedFileType(_ frame: Sharing_Nearby_Frame) {
log("Rejecting transfer due to unsupported file type. Frame is \(frame.debugDescription)")
NearbyConnectionManager.shared.mainAppDelegate?.showUnsupportedFileAlert(for: remoteDeviceInfo)
rejectTransfer(with: .unsupportedAttachmentType)
}
func submitUserConsent(accepted: Bool, storeInTemp: Bool = false) {
DispatchQueue.global(qos: .utility).async {
@@ -146,6 +146,7 @@ public protocol MainAppDelegate {
func incomingTransfer(id: String, didFinishWith error: Error?)
func showFirewallAlert()
func showCopiedToClipboardAlert()
func showUnsupportedFileAlert(for: RemoteDeviceInfo?)
}
public protocol ShareExtensionDelegate: AnyObject {