2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-29 13:17:43 +00:00

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.
This commit is contained in:
Simon Redman 2023-01-20 21:21:30 -05:00
parent f74336da30
commit e76da90fa9

View File

@ -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;
}
}