All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.com.sceyt.chatuikit.persistence.dao.AutoDeleteMessageDao.kt Maven / Gradle / Ivy

There is a newer version: 1.7.2
Show newest version
package com.sceyt.chatuikit.persistence.dao

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.sceyt.chatuikit.persistence.entity.messages.AutoDeleteMessageEntity

@Dao
interface AutoDeleteMessageDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insertAutoDeletedMessages(messages: List)

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insertAutoDeletedMessage(message: AutoDeleteMessageEntity)

    @Query("select * from AutoDeleteMessages where channelId = :channelId and autoDeleteAt <= :localTime")
    suspend fun getOutdatedMessages(channelId: Long, localTime: Long): List

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy