mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-26 00:06:02 +00:00
Add progress notification when receiving files
This commit is contained in:
1 parent
673d4418f8
commit
1ac988a4fc
11 files changed
+308
-52
No files matched your search
@@ -521,6 +521,19 @@ class NearbyConnection {
|
||||
}
|
||||
|
||||
|
||||
func cancel() {
|
||||
cancelled = true
|
||||
if encryptionDone {
|
||||
var cancel = Sharing_Nearby_Frame()
|
||||
cancel.version = .v1
|
||||
cancel.v1 = Sharing_Nearby_V1Frame()
|
||||
cancel.v1.type = .cancel
|
||||
try? sendTransferSetupFrame(cancel)
|
||||
}
|
||||
try? sendDisconnectionAndDisconnect()
|
||||
}
|
||||
|
||||
|
||||
func disconnect() {
|
||||
log("[NearbyConnection \(self.id)] Disconnecting from connection.")
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb
|
||||
|
||||
public func becomeInvisible() {
|
||||
if !startedAdvertising {
|
||||
print("[NearbyConnectionManager] Already invisible, ignoring becomeInvisible()")
|
||||
log("[NearbyConnectionManager] Already invisible, ignoring becomeInvisible()")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb
|
||||
|
||||
|
||||
func updatedTransferProgress(connection: InboundNearbyConnection, progress: Double) {
|
||||
mainAppDelegate?.transferProgress(progress: progress)
|
||||
mainAppDelegate?.transferProgress(connectionID: connection.id, progress: progress)
|
||||
}
|
||||
|
||||
|
||||
@@ -308,9 +308,14 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb
|
||||
}
|
||||
|
||||
|
||||
public func cancelOutgoingTransfer(id: String) {
|
||||
guard let transfer = outgoingTransfers[id] else { return }
|
||||
transfer.connection.cancel()
|
||||
public func cancelTransfer(id: String) {
|
||||
|
||||
if let transfer = incomingConnections[id] {
|
||||
transfer.cancel()
|
||||
}
|
||||
if let transfer = outgoingTransfers[id] {
|
||||
transfer.connection.cancel()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -68,19 +68,6 @@ class OutboundNearbyConnection: NearbyConnection {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public func cancel() {
|
||||
cancelled = true
|
||||
if encryptionDone {
|
||||
var cancel = Sharing_Nearby_Frame()
|
||||
cancel.version = .v1
|
||||
cancel.v1 = Sharing_Nearby_V1Frame()
|
||||
cancel.v1.type = .cancel
|
||||
try? sendTransferSetupFrame(cancel)
|
||||
}
|
||||
try? sendDisconnectionAndDisconnect()
|
||||
}
|
||||
|
||||
|
||||
override func connectionReady() {
|
||||
|
||||
Reference in new issue
Block a user