Merge branch 'master' into add-sms-draft

This commit is contained in:
Agnieszka C 2021-09-08 15:12:05 +02:00 committed by GitHub
commit 02a8633ffd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View file

@ -813,6 +813,17 @@ fun Context.deleteSmsDraft(threadId: Long) {
contentResolver.delete(uri, null, null)
}
}
}
}
fun Context.updateLastConversationMessage(threadId: Long) {
val uri = Threads.CONTENT_URI
val selection = "${Threads._ID} = ?"
val selectionArgs = arrayOf(threadId.toString())
try {
contentResolver.delete(uri, selection, selectionArgs)
val newConversation = getConversations(threadId)[0]
conversationsDB.insertOrUpdate(newConversation)
} catch (e: Exception) {
}
}