diff options
Diffstat (limited to 'app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListLiveData.kt')
-rw-r--r-- | app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListLiveData.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListLiveData.kt b/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListLiveData.kt index 70ea54e..cada4bc 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListLiveData.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/status/nodes/NodeListLiveData.kt | |||
@@ -25,12 +25,12 @@ import java.util.concurrent.TimeUnit | |||
25 | /** | 25 | /** |
26 | * @author pacien | 26 | * @author pacien |
27 | */ | 27 | */ |
28 | class NodeListLiveData(private val netName: String) : SelfRefreshingLiveData<List<String>>(1, TimeUnit.SECONDS) { | 28 | class NodeListLiveData(private val netName: String) : SelfRefreshingLiveData<List<NodeInfo>>(1, TimeUnit.SECONDS) { |
29 | private val tincCtl = Tinc | 29 | private val tincCtl = Tinc |
30 | 30 | ||
31 | override fun onRefresh() { | 31 | override fun onRefresh() { |
32 | val nodeList = tincCtl.dumpNodes(netName) | 32 | val nodeList = tincCtl.dumpNodes(netName) |
33 | .thenApply { list -> list.map { it.substringBefore(' ') } } | 33 | .thenApply { list -> list.map { NodeInfo.ofNodeDump(it) } } |
34 | .get() | 34 | .get() |
35 | 35 | ||
36 | postValue(nodeList) | 36 | postValue(nodeList) |