From 35e914188850bee52ec4e3af181e344453bf196b Mon Sep 17 00:00:00 2001 From: Naveen Date: Thu, 8 Dec 2022 01:42:43 +0530 Subject: [PATCH] Use a separate notification id for failure notifications This way failure notifications won't overwrite the existing chat notifications (if there are any) as they also use thread id as notification id --- .../smsmessenger/helpers/NotificationHelper.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/NotificationHelper.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/NotificationHelper.kt index 0a226824..827cc804 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/NotificationHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/helpers/NotificationHelper.kt @@ -119,7 +119,7 @@ class NotificationHelper(private val context: Context) { fun showSendingFailedNotification(recipientName: String, threadId: Long) { maybeCreateChannel(name = context.getString(R.string.message_not_sent_short)) - val notificationId = threadId.hashCode() + val notificationId = generateRandomId().hashCode() val intent = Intent(context, ThreadActivity::class.java).apply { putExtra(THREAD_ID, threadId) }