Avoids comparisons with the torConnection as part of the data class

This commit is contained in:
Vitor Pamplona
2025-08-28 14:23:26 -04:00
parent b80685dcfb
commit f7eb043aac
2 changed files with 7 additions and 3 deletions

View File

@@ -62,7 +62,10 @@ class TorService(
delay(100)
}
trySend(TorServiceStatus.Active(torService.socksPort, torService.torControlConnection))
val active = TorServiceStatus.Active(torService.socksPort)
active.torControlConnection = torService.torControlConnection
trySend(active)
Log.d("TorService", "Tor Service Connected ${torService.socksPort}")
}
}

View File

@@ -25,8 +25,9 @@ import net.freehaven.tor.control.TorControlConnection
sealed class TorServiceStatus {
data class Active(
val port: Int,
val torControlConnection: TorControlConnection,
) : TorServiceStatus()
) : TorServiceStatus() {
lateinit var torControlConnection: TorControlConnection
}
object Off : TorServiceStatus()