Persist sub id when sending sms messages

This commit is contained in:
Naveen 2022-11-21 21:00:26 +05:30
parent 75bbd5ea0e
commit e0787d7c83
2 changed files with 0 additions and 24 deletions

View file

@ -676,16 +676,6 @@ fun Context.updateMessageStatus(id: Long, status: Int) {
contentResolver.update(uri, contentValues, selection, selectionArgs)
}
fun Context.updateMessageSubscriptionId(messageId: Long, subscriptionId: Int) {
val uri = Sms.CONTENT_URI
val contentValues = ContentValues().apply {
put(Sms.SUBSCRIPTION_ID, subscriptionId)
}
val selection = "${Sms._ID} = ?"
val selectionArgs = arrayOf(messageId.toString())
contentResolver.update(uri, contentValues, selection, selectionArgs)
}
fun Context.updateUnreadCountBadge(conversations: List<Conversation>) {
val unreadCount = conversations.count { !it.read }
if (unreadCount == 0) {