properly handle inserting and deleting threads from local db
This commit is contained in:
parent
2b3df2719b
commit
35c205605d
4 changed files with 40 additions and 13 deletions
|
|
@ -9,11 +9,14 @@ import com.simplemobiletools.smsmessenger.models.Conversation
|
|||
@Dao
|
||||
interface ConversationsDao {
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
fun insert(conversation: Conversation): Long
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
fun insertAll(conversations: List<Conversation>)
|
||||
fun insertOrUpdate(conversation: Conversation): Long
|
||||
|
||||
@Query("SELECT * FROM conversations")
|
||||
fun getAll(): List<Conversation>
|
||||
|
||||
@Query("DELETE FROM conversations WHERE id = :id")
|
||||
fun delete(id: Long)
|
||||
|
||||
@Query("DELETE FROM conversations WHERE system_id = :threadId")
|
||||
fun deleteThreadId(threadId: Long)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue