From e76da90fa960a502d44a22eb6c206961434325b1 Mon Sep 17 00:00:00 2001 From: Simon Redman Date: Fri, 20 Jan 2023 21:21:30 -0500 Subject: [PATCH] Correct logic error when determining which "new" messages to return With the old logic, the mostRecentTimestamp would effectively only be updated once, the first time the app noticed an SMS/MMS. This means that, until the app was next closed, it would return every message sent or received after that timestamp. Since the app doesn't crash as often as it used to, this can grow to a quite significant number of messages. --- src/org/kde/kdeconnect/Plugins/SMSPlugin/SMSPlugin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/kde/kdeconnect/Plugins/SMSPlugin/SMSPlugin.java b/src/org/kde/kdeconnect/Plugins/SMSPlugin/SMSPlugin.java index 13e07054..d57ee647 100644 --- a/src/org/kde/kdeconnect/Plugins/SMSPlugin/SMSPlugin.java +++ b/src/org/kde/kdeconnect/Plugins/SMSPlugin/SMSPlugin.java @@ -279,8 +279,8 @@ public class SMSPlugin extends Plugin { long newMostRecentTimestamp = mostRecentTimestamp; for (SMSHelper.Message message : messages) { - if (message == null || message.date <= newMostRecentTimestamp) { - newMostRecentTimestamp = message.date; + if (message == null || message.date >= newMostRecentTimestamp) { + newMostRecentTimestamp = message.date; } }