From f4482247bc834444bcd2c055c6b8ec2d944053c6 Mon Sep 17 00:00:00 2001 From: keepalivedev Date: Tue, 28 Nov 2023 14:39:58 -0600 Subject: [PATCH] ignore disabled SMS contacts --- app/src/main/java/io/keepalive/android/AlertFunctions.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/io/keepalive/android/AlertFunctions.kt b/app/src/main/java/io/keepalive/android/AlertFunctions.kt index 7266f15..ea0fe20 100644 --- a/app/src/main/java/io/keepalive/android/AlertFunctions.kt +++ b/app/src/main/java/io/keepalive/android/AlertFunctions.kt @@ -75,6 +75,11 @@ fun sendAlertMessages(context: Context, locationStr: String) { // iterate through the contacts and send 1 or 2 SMS messages to each for (contact in smsContacts) { + // if the contact is disabled then skip it + if (!contact.isEnabled) { + continue + } + Log.d( "sendAlertMessage", "Alert message is ${contact.alertMessage}, " + "SMS contact number is ${contact.phoneNumber}"