From e8a53d06c1030e2dcfc56579967554418e01484a Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 15 Apr 2021 11:58:11 +0200 Subject: [PATCH] make sure the conversation are properly refreshed when open --- .../smsmessenger/receivers/SmsReceiver.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/receivers/SmsReceiver.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/receivers/SmsReceiver.kt index cc2efb88..e31ac96d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/receivers/SmsReceiver.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/receivers/SmsReceiver.kt @@ -44,13 +44,14 @@ class SmsReceiver : BroadcastReceiver() { context.updateUnreadCountBadge(context.conversationsDB.getUnreadConversations()) val participant = SimpleContact(0, 0, address, "", arrayListOf(address), ArrayList(), ArrayList()) - val message = Message(newMessageId, body, type, arrayListOf(participant), (date / 1000).toInt(), false, threadId, - false, null, address, "", subscriptionId) + val participants = arrayListOf(participant) + val messageDate = (date / 1000).toInt() + val message = Message(newMessageId, body, type, participants, messageDate, false, threadId, false, null, address, "", subscriptionId) context.messagesDB.insertOrUpdate(message) + refreshMessages() } context.showReceivedMessageNotification(address, body, threadId, null) - refreshMessages() } } }