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

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

Loading…
Cancel
Save