feat: add dialog for message status information

This commit is contained in:
andrekir 2024-09-24 19:39:20 -03:00 committed by Andre K
parent 056f6b28cf
commit a075dfbd3a
16 changed files with 803 additions and 103 deletions

View file

@ -36,8 +36,9 @@ import com.geeksville.mesh.database.entity.QuickChatAction
AutoMigration (from = 7, to = 8),
AutoMigration (from = 8, to = 9),
AutoMigration (from = 9, to = 10),
AutoMigration (from = 10, to = 11),
],
version = 10,
version = 11,
exportSchema = true,
)
@TypeConverters(Converters::class)

View file

@ -50,8 +50,8 @@ class PacketRepository @Inject constructor(private val packetDaoLazy: dagger.Laz
packetDao.updateMessageId(d, id)
}
suspend fun getDataPacketById(requestId: Int) = withContext(Dispatchers.IO) {
packetDao.getDataPacketById(requestId)
suspend fun getPacketById(requestId: Int) = withContext(Dispatchers.IO) {
packetDao.getPacketById(requestId)
}
suspend fun deleteMessages(uuidList: List<Long>) = withContext(Dispatchers.IO) {

View file

@ -130,10 +130,15 @@ interface PacketDao {
)
fun getDataPackets(): List<DataPacket>
@Transaction
fun getDataPacketById(requestId: Int): DataPacket? {
return getDataPackets().lastOrNull { it.id == requestId }
}
@Query(
"""
SELECT * FROM packet
WHERE (myNodeNum = 0 OR myNodeNum = (SELECT myNodeNum FROM MyNodeInfo))
AND packet_id = :requestId
ORDER BY received_time DESC
"""
)
fun getPacketById(requestId: Int): Packet?
@Transaction
fun getQueuedPackets(): List<DataPacket>? =

View file

@ -22,7 +22,9 @@ data class Packet(
@ColumnInfo(name = "contact_key") val contact_key: String,
@ColumnInfo(name = "received_time") val received_time: Long,
@ColumnInfo(name = "read", defaultValue = "1") val read: Boolean,
@ColumnInfo(name = "data") val data: DataPacket
@ColumnInfo(name = "data") val data: DataPacket,
@ColumnInfo(name = "packet_id", defaultValue = "0") val packetId: Int = 0,
@ColumnInfo(name = "routing_error", defaultValue = "-1") var routingError: Int = -1,
)
@Entity(tableName = "contact_settings")