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:
parent
f74336da30
commit
e76da90fa9
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user