fix #231 message history disappears thanks @dylanhoen

// Now that we use data packets for more things, we need to be choosier about what we keep.  Since (currently - in the future less so)
        // we only care about old text messages, we just store those...
This commit is contained in:
Kevin Hester 2021-02-06 13:24:48 +08:00
parent 9c15e22b8f
commit 4a5e07e52f
2 changed files with 16 additions and 11 deletions

View file

@ -805,8 +805,9 @@ class MainActivity : AppCompatActivity(), Logging,
registerMeshReceiver()
// Init our messages table with the service's record of past text messages (ignore all other message types)
val allMsgs = service.oldMessages
val msgs =
service.oldMessages.filter { p -> p.dataType == Portnums.PortNum.TEXT_MESSAGE_APP_VALUE }
allMsgs.filter { p -> p.dataType == Portnums.PortNum.TEXT_MESSAGE_APP_VALUE }
debug("Service provided ${msgs.size} messages and myNodeNum ${service.myNodeInfo?.myNodeNum}")
model.myNodeInfo.value = service.myNodeInfo
model.messagesState.setMessages(msgs)