mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-23 06:46:03 +00:00
Add detection of unsupported file type
This commit is contained in:
1 parent
e7654313f3
commit
6b883e9457
20 files changed
+47
-3
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user