From 14eb53d09bd500b49e870bf1b25927fdeba2ecbb Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Mon, 4 Nov 2024 15:01:30 -0600 Subject: [PATCH] Ensure OPEN_MESSAGE_EXTRA_CONTACT_KEY is always set The `openMessageIntent` function is modified to always include the `OPEN_MESSAGE_EXTRA_CONTACT_KEY` in the intent, ensuring that the message recipient is always specified when opening the message activity. --- .../com/geeksville/mesh/service/MeshServiceNotifications.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/service/MeshServiceNotifications.kt b/app/src/main/java/com/geeksville/mesh/service/MeshServiceNotifications.kt index 250324fa2..4929847a9 100644 --- a/app/src/main/java/com/geeksville/mesh/service/MeshServiceNotifications.kt +++ b/app/src/main/java/com/geeksville/mesh/service/MeshServiceNotifications.kt @@ -189,12 +189,10 @@ class MeshServiceNotifications( ) } - private fun openMessageIntent(contactKey: String? = null): PendingIntent { + private fun openMessageIntent(contactKey: String): PendingIntent { val intent = Intent(context, MainActivity::class.java) intent.action = OPEN_MESSAGE_ACTION - contactKey?.let { - intent.putExtra(OPEN_MESSAGE_EXTRA_CONTACT_KEY, it) - } + intent.putExtra(OPEN_MESSAGE_EXTRA_CONTACT_KEY, contactKey) val pendingIntent = PendingIntent.getActivity( context, 0,