mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-02-17 04:00:35 +01:00
make sure received messages are stored on the background thread
This commit is contained in:
parent
738c41715b
commit
953d521e47
@ -56,7 +56,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.simplemobiletools:commons:5.31.20'
|
||||
implementation 'com.simplemobiletools:commons:5.31.21'
|
||||
implementation 'org.greenrobot:eventbus:3.2.0'
|
||||
implementation 'com.klinkerapps:android-smsmms:5.2.6'
|
||||
implementation 'com.github.tibbi:IndicatorFastScroll:08f512858a'
|
||||
|
@ -30,15 +30,16 @@ class SmsReceiver : BroadcastReceiver() {
|
||||
}
|
||||
|
||||
if (!context.isNumberBlocked(address)) {
|
||||
context.insertNewSMS(address, subject, body, date, read, threadId, type, subscriptionId)
|
||||
context.showReceivedMessageNotification(address, body, threadId.toInt(), null)
|
||||
refreshMessages()
|
||||
|
||||
ensureBackgroundThread {
|
||||
context.insertNewSMS(address, subject, body, date, read, threadId, type, subscriptionId)
|
||||
|
||||
val conversation = context.getConversations(threadId).firstOrNull() ?: return@ensureBackgroundThread
|
||||
context.conversationsDB.insertOrUpdate(conversation)
|
||||
context.updateUnreadCountBadge(context.conversationsDB.getUnreadConversations())
|
||||
}
|
||||
|
||||
context.showReceivedMessageNotification(address, body, threadId.toInt(), null)
|
||||
refreshMessages()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user