mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: use is_unmessagable flag (#1965)
This commit is contained in:
parent
dcae34a786
commit
0a91464cfc
1 changed files with 7 additions and 5 deletions
|
|
@ -105,11 +105,13 @@ fun NodeItem(
|
|||
|
||||
val (detailsShown, showDetails) = remember { mutableStateOf(expanded) }
|
||||
val unmessageable = remember(thatNode) {
|
||||
val firmwareVersion = DeviceVersion(thatNode.metadata?.firmwareVersion ?: "")
|
||||
if (firmwareVersion >= DeviceVersion("2.6.8")) {
|
||||
thatNode.user.isUnmessagable
|
||||
} else {
|
||||
thatNode.user.role?.isUnmessageableRole() == true
|
||||
when {
|
||||
thatNode.user.hasIsUnmessagable() -> thatNode.user.isUnmessagable
|
||||
thatNode.user.role.isUnmessageableRole() ->
|
||||
thatNode.metadata?.firmwareVersion?.let {
|
||||
DeviceVersion(it) < DeviceVersion("2.6.8")
|
||||
} ?: true
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue