feat: Display relay node information for messages (#3574)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2025-10-30 17:25:34 -05:00 committed by GitHub
parent 7d1c5cba4c
commit 453dd398d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 840 additions and 16 deletions

View file

@ -42,7 +42,6 @@ import org.meshtastic.core.model.util.onlineTimeThreshold
import org.meshtastic.proto.MeshProtos
import javax.inject.Inject
import javax.inject.Singleton
import kotlin.collections.map
@Singleton
@Suppress("TooManyFunctions")
@ -94,8 +93,20 @@ constructor(
fun getUser(userId: String): MeshProtos.User = nodeDBbyNum.value.values.find { it.user.id == userId }?.user
?: MeshProtos.User.newBuilder()
.setId(userId)
.setLongName("Meshtastic ${userId.takeLast(n = 4)}")
.setShortName(userId.takeLast(n = 4))
.setLongName(
if (userId == "^local") {
"Local"
} else {
"Meshtastic ${userId.takeLast(n = 4)}"
},
)
.setShortName(
if (userId == "^local") {
"Local"
} else {
userId.takeLast(n = 4)
},
)
.setHwModel(MeshProtos.HardwareModel.UNSET)
.build()