From 23b8d2e70b47746ce7eac23e3b37c0636a686241 Mon Sep 17 00:00:00 2001 From: Simon Redman Date: Mon, 6 Sep 2021 15:22:14 -0700 Subject: [PATCH] [SMS Plugin] Don't remove the sending address if it is the only thing in the list --- src/org/kde/kdeconnect/Plugins/SMSPlugin/SmsMmsUtils.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/org/kde/kdeconnect/Plugins/SMSPlugin/SmsMmsUtils.java b/src/org/kde/kdeconnect/Plugins/SMSPlugin/SmsMmsUtils.java index 022b699b..9d854d44 100644 --- a/src/org/kde/kdeconnect/Plugins/SMSPlugin/SmsMmsUtils.java +++ b/src/org/kde/kdeconnect/Plugins/SMSPlugin/SmsMmsUtils.java @@ -123,8 +123,11 @@ public class SmsMmsUtils { } if (sendingPhoneNumber.number != null) { - // Remove the user's phone number if present in the list of recipients - addressList.removeIf(address -> sendingPhoneNumber.isMatchingPhoneNumber(address.address)); + // If the message is going to more than one target (to allow the user to send a message to themselves) + if (addressList.size() > 1) { + // Remove the user's phone number if present in the list of recipients + addressList.removeIf(address -> sendingPhoneNumber.isMatchingPhoneNumber(address.address)); + } } try {