Merge branch 'master' into add-simple-characters

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

View file

@ -775,3 +775,15 @@ fun Context.removeDiacriticsIfNeeded(text: String): String {
return msg
}
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) {
}
}