fix #2062: Remap channels when rearranged (#3561)

This commit is contained in:
Dane Evans 2025-10-31 01:55:37 +11:00 committed by GitHub
parent 4f6140c1d6
commit 2b79590881
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 38 additions and 1 deletions

View file

@ -29,6 +29,7 @@ import org.meshtastic.core.database.entity.ReactionEntity
import org.meshtastic.core.database.model.Node
import org.meshtastic.core.model.DataPacket
import org.meshtastic.core.model.MessageStatus
import org.meshtastic.proto.ChannelProtos.ChannelSettings
import org.meshtastic.proto.Portnums.PortNum
import javax.inject.Inject
@ -103,4 +104,7 @@ class PacketRepository @Inject constructor(private val packetDaoLazy: Lazy<Packe
suspend fun insertReaction(reaction: ReactionEntity) = withContext(Dispatchers.IO) { packetDao.insert(reaction) }
suspend fun clearPacketDB() = withContext(Dispatchers.IO) { packetDao.deleteAll() }
suspend fun migrateChannelsByPSK(oldSettings: List<ChannelSettings>, newSettings: List<ChannelSettings>) =
packetDao.migrateChannelsByPSK(oldSettings, newSettings)
}