Skip to content

Linux + iPhone Continuity / iMessage / SMS

fix(ios): app does not readvertise mdns after foregrounding

Zack Bartelafcb13677b42
diff --git a/apple/Tether/ViewModels/TetherViewModel.swift b/apple/Tether/ViewModels/TetherViewModel.swift
index 6b020bd..c0d03c2 100644
--- a/apple/Tether/ViewModels/TetherViewModel.swift
+++ b/apple/Tether/ViewModels/TetherViewModel.swift
@@ -214,6 +214,7 @@ final class TetherViewModel {
case .active:
manualDisconnect = false
reconnectAttempts = 0
+ startServer()
refreshDiscovery()
case .background:
pendingReconnectTask?.cancel()
@@ -521,11 +522,17 @@ final class TetherViewModel {
server.onNewConnection = { [weak self] incomingConn, incomingFingerprint in
guard let self = self else { return }
- // A live or in-flight session is not displaced by a stranger dialling in.
- guard self.appState == .disconnected || self.appState == .discovering else {
+ guard self.appState != .connected else {
incomingConn.cancel()
return
}
+ if self.appState == .connecting || self.appState == .pairing {
+ self.cancelConnectTimeout()
+ self.pendingReconnectTask?.cancel()
+ self.pendingReconnectTask = nil
+ self.autoConnectingFingerprint = nil
+ self.showPairingSheet = false
+ }
// We just received an incoming connection from a peer!
// We give it to our connection manager and start decoding.
diff --git a/src/gtk/devices_view.cpp b/src/gtk/devices_view.cpp
index e95b14f..3b10edb 100644
--- a/src/gtk/devices_view.cpp
+++ b/src/gtk/devices_view.cpp
@@ -613,6 +613,7 @@ namespace tether::ui {
nlohmann::json j;
j["command"] = "accept_device";
j["fingerprint"] = g_devices.selected_device_fp;
+ j["device_name"] = g_devices.selected_device_name;
daemon_send(j);
}