mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: optimize database storage for specific Portnums
This commit is contained in:
parent
17982efbea
commit
57e29b23a3
1 changed files with 6 additions and 0 deletions
|
|
@ -564,7 +564,13 @@ class MeshService : Service(), Logging {
|
|||
}
|
||||
}
|
||||
|
||||
private val rememberDataType = setOf(
|
||||
Portnums.PortNum.TEXT_MESSAGE_APP_VALUE,
|
||||
Portnums.PortNum.WAYPOINT_APP_VALUE,
|
||||
)
|
||||
|
||||
private fun rememberDataPacket(dataPacket: DataPacket) {
|
||||
if (dataPacket.dataType !in rememberDataType) return
|
||||
val fromLocal = dataPacket.from == DataPacket.ID_LOCAL
|
||||
val toBroadcast = dataPacket.to == DataPacket.ID_BROADCAST
|
||||
val contactId = if (fromLocal || toBroadcast) dataPacket.to else dataPacket.from
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue