mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Feat/2061 public ind (#2284)
This commit is contained in:
parent
80723c59cc
commit
3d9b69eda5
5 changed files with 92 additions and 14 deletions
|
|
@ -177,6 +177,7 @@ data class Contact(
|
|||
val isMuted: Boolean,
|
||||
val isUnmessageable: Boolean,
|
||||
val nodeColors: Pair<Int, Int>? = null,
|
||||
val isDefaultPSK: Boolean? = false
|
||||
)
|
||||
|
||||
@Suppress("LongParameterList", "LargeClass")
|
||||
|
|
@ -519,6 +520,15 @@ class UIViewModel @Inject constructor(
|
|||
} else {
|
||||
user.longName
|
||||
}
|
||||
val isDefaultPSK = if (toBroadcast) {
|
||||
val _channel = channelSet.getChannel(data.channel)
|
||||
val isDefaultPSK = (_channel?.settings?.psk?.size() == 1 &&
|
||||
_channel.settings.psk.byteAt(0) == 1.toByte()) ||
|
||||
_channel?.settings?.psk?.toByteArray()?.isEmpty() == true
|
||||
isDefaultPSK
|
||||
} else {
|
||||
false
|
||||
}
|
||||
|
||||
Contact(
|
||||
contactKey = contactKey,
|
||||
|
|
@ -535,6 +545,7 @@ class UIViewModel @Inject constructor(
|
|||
} else {
|
||||
null
|
||||
},
|
||||
isDefaultPSK = isDefaultPSK
|
||||
)
|
||||
}
|
||||
}.stateIn(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue