mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat: Use node colors for contact chip (#1891)
This commit is contained in:
parent
01fb50647a
commit
2f13aee171
2 changed files with 18 additions and 1 deletions
|
|
@ -167,6 +167,7 @@ data class Contact(
|
|||
val messageCount: Int,
|
||||
val isMuted: Boolean,
|
||||
val isUnmessageable: Boolean,
|
||||
val nodeColors: Pair<Int, Int>? = null,
|
||||
)
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
|
|
@ -385,6 +386,7 @@ class UIViewModel @Inject constructor(
|
|||
|
||||
// grab usernames from NodeInfo
|
||||
val user = getUser(if (fromLocal) data.to else data.from)
|
||||
val node = getNode(if (fromLocal) data.to else data.from)
|
||||
|
||||
val shortName = user.shortName
|
||||
val longName = if (toBroadcast) {
|
||||
|
|
@ -403,6 +405,11 @@ class UIViewModel @Inject constructor(
|
|||
messageCount = packetRepository.getMessageCount(contactKey),
|
||||
isMuted = settings[contactKey]?.isMuted == true,
|
||||
isUnmessageable = user.isUnmessagable,
|
||||
nodeColors = if (!toBroadcast) {
|
||||
node.colors
|
||||
} else {
|
||||
null
|
||||
},
|
||||
)
|
||||
}
|
||||
}.stateIn(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue