pull/212/head
M66B 2 years ago
parent c3a20922ea
commit 873a751a17

@ -3014,7 +3014,7 @@ class Core {
imessages.length > 0 && folder.last_sync_count != null &&
imessages.length == folder.last_sync_count) {
// Check if last message known as new messages indicator
MessageHelper helper = new MessageHelper((MimeMessage) imessages[imessages.length - 1], context);
MessageHelper helper = new MessageHelper((MimeMessage) imessages[reversed ? 0 : imessages.length - 1], context);
String msgid = helper.getPOP3MessageID();
if (msgid != null) {
int count = db.message().countMessageByMsgId(folder.id, msgid, true);
@ -3430,11 +3430,10 @@ class Core {
}
if (account.max_messages != null && !account.leave_on_device) {
int hidden = db.message().setMessagesUiHide(folder.id, Math.abs(account.max_messages) + flagged);
int deleted = db.message().deleteMessagesKeep(folder.id, Math.abs(account.max_messages) + flagged + 100);
int hidden = db.message().setMessagesUiHide(folder.id, Math.abs(account.max_messages));
int deleted = db.message().deleteMessagesKeep(folder.id, Math.abs(account.max_messages) + 100);
EntityLog.log(context, account.name + " POP" +
" cleanup max=" + account.max_messages +
" flagged=" + flagged +
" hidden=" + hidden +
" deleted=" + deleted);
}

@ -789,6 +789,7 @@ public interface DaoMessage {
@Transaction
@Query("UPDATE message SET ui_hide = 1" +
" WHERE folder = :folder" +
" AND NOT ui_flagged" +
" AND id NOT IN (" +
" SELECT id FROM message" +
" WHERE folder = :folder" +
@ -1015,6 +1016,7 @@ public interface DaoMessage {
@Transaction
@Query("DELETE FROM message" +
" WHERE folder = :folder" +
" AND NOT ui_flagged" +
" AND id NOT IN (" +
" SELECT id FROM message" +
" WHERE folder = :folder" +

Loading…
Cancel
Save