fix node id lookups

This commit is contained in:
geeksville 2020-02-25 10:30:10 -08:00
parent 2c8c7ac8d6
commit b5fc637f30
5 changed files with 37 additions and 22 deletions

View file

@ -495,8 +495,9 @@ class MeshService : Service(), Logging {
/// Update our DB of users based on someone sending out a User subpacket
private fun handleReceivedUser(fromNum: Int, p: MeshProtos.User) {
updateNodeInfo(fromNum) {
val oldId = it.user?.id.orEmpty()
it.user = MeshUser(
p.id,
if (p.id.isNotEmpty()) p.id else oldId, // If the new update doesn't contain an ID keep our old value
p.longName,
p.shortName
)