mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat(settings): Allow clearing the node status message (#4577)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
eb2f04117a
commit
558cf77768
4 changed files with 21 additions and 6 deletions
|
|
@ -239,7 +239,7 @@ constructor(
|
|||
fun handleSetModuleConfig(id: Int, destNum: Int, payload: ByteArray) {
|
||||
val c = ModuleConfig.ADAPTER.decode(payload)
|
||||
commandSender.sendAdmin(destNum, id) { AdminMessage(set_module_config = c) }
|
||||
c.statusmessage?.node_status?.let { status -> nodeManager.updateNodeStatus(destNum, status) }
|
||||
c.statusmessage?.let { sm -> nodeManager.updateNodeStatus(destNum, sm.node_status) }
|
||||
}
|
||||
|
||||
fun handleGetModuleConfig(id: Int, destNum: Int, config: Int) {
|
||||
|
|
|
|||
|
|
@ -66,8 +66,8 @@ constructor(
|
|||
scope.handledLaunch { radioConfigRepository.setLocalModuleConfig(config) }
|
||||
serviceRepository.setConnectionProgress("Module config received")
|
||||
|
||||
config.statusmessage?.node_status?.let { status ->
|
||||
nodeManager.myNodeNum?.let { num -> nodeManager.updateNodeStatus(num, status) }
|
||||
config.statusmessage?.let { sm ->
|
||||
nodeManager.myNodeNum?.let { num -> nodeManager.updateNodeStatus(num, sm.node_status) }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -213,8 +213,8 @@ constructor(
|
|||
updateNodeStatus(fromNum, s.status)
|
||||
}
|
||||
|
||||
fun updateNodeStatus(nodeNum: Int, status: String) {
|
||||
updateNodeInfo(nodeNum) { it.nodeStatus = status }
|
||||
fun updateNodeStatus(nodeNum: Int, status: String?) {
|
||||
updateNodeInfo(nodeNum) { it.nodeStatus = status?.takeIf { s -> s.isNotEmpty() } }
|
||||
}
|
||||
|
||||
fun installNodeInfo(info: ProtoNodeInfo, withBroadcast: Boolean = true) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue