|
@@ -30,7 +30,7 @@ interface MessageStatusDao {
|
|
|
pin: String
|
|
|
)
|
|
|
|
|
|
- @Query("update MessageStatus set status = :status, last_update = :lastUpdate, time_delivered = :timeDelivered where message_id = :messageId and f_pin = :pin")
|
|
|
+ @Query("update MessageStatus set status = :status, last_update = :lastUpdate, time_delivered = :timeDelivered where message_id = :messageId and f_pin = :pin and status < :status")
|
|
|
suspend fun updateDelivered(
|
|
|
status: Int,
|
|
|
lastUpdate: Long = System.currentTimeMillis(),
|
|
@@ -39,7 +39,7 @@ interface MessageStatusDao {
|
|
|
pin: String
|
|
|
)
|
|
|
|
|
|
- @Query("update MessageStatus set status = :status, last_update = :lastUpdate, time_read = :timeRead where message_id = :messageId and f_pin = :pin")
|
|
|
+ @Query("update MessageStatus set status = :status, last_update = :lastUpdate, time_read = :timeRead where message_id = :messageId and f_pin = :pin and status < :status")
|
|
|
suspend fun updateRead(
|
|
|
status: Int,
|
|
|
lastUpdate: Long = System.currentTimeMillis(),
|
|
@@ -48,7 +48,7 @@ interface MessageStatusDao {
|
|
|
pin: String
|
|
|
)
|
|
|
|
|
|
- @Query("update MessageStatus set status = :status, last_update = :lastUpdate, time_ack = :timeAck where message_id = :messageId and f_pin = :pin")
|
|
|
+ @Query("update MessageStatus set status = :status, last_update = :lastUpdate, time_ack = :timeAck where message_id = :messageId and f_pin = :pin and status < :status")
|
|
|
suspend fun updateAck(
|
|
|
status: Int,
|
|
|
lastUpdate: Long = System.currentTimeMillis(),
|