Feat/2334 channel indicators (#2356)

Signed-off-by: DaneEvans <dane@goneepic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
DaneEvans 2025-07-07 12:31:36 +10:00 committed by GitHub
parent ffd399f44d
commit aa9ce9dfdf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 318 additions and 98 deletions

View file

@ -176,8 +176,7 @@ data class Contact(
val messageCount: Int,
val isMuted: Boolean,
val isUnmessageable: Boolean,
val nodeColors: Pair<Int, Int>? = null,
val isDefaultPSK: Boolean? = false
val nodeColors: Pair<Int, Int>? = null
)
@Suppress("LongParameterList", "LargeClass")
@ -520,15 +519,6 @@ 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,
@ -544,8 +534,7 @@ class UIViewModel @Inject constructor(
node.colors
} else {
null
},
isDefaultPSK = isDefaultPSK
}
)
}
}.stateIn(