feat(*): add sender to files pack result

This commit is contained in:
ksenia312
2024-02-04 22:25:57 +01:00
parent a1ac4488ca
commit d6840a4313
25 changed files with 199 additions and 152 deletions
+7 -2
View File
@@ -124,8 +124,13 @@ class NearbyManager: NSObject {
do {
let device = NearbyDevicesStore.instance.find(for: receiverId)
if let requireDevice = device {
try requireDevice.session?.session?.send(
try JSONSerialization.data(withJSONObject: NearbyStartCommand( id: id, filesCount: paths.count).toDictionary()),
let command = NearbyStartCommand(
senderName: requireDevice.name,
filesCount: paths.count
).toDictionary()
try requireDevice.session?.session?.send(
try JSONSerialization.data(withJSONObject: command),
toPeers: [requireDevice.peerID],
with: MCSessionSendDataMode.reliable
)