Keep flagged POP3 messages on device

pull/209/head
M66B 2 years ago
parent 0cb62d9192
commit 52f4f2acf9

@ -3019,10 +3019,11 @@ class Core {
known.remove(uidl); known.remove(uidl);
} }
for (TupleUidl uidl : known.values()) { for (TupleUidl uidl : known.values())
EntityLog.log(context, account.name + " POP purging uidl=" + uidl.uidl); if (!uidl.ui_flagged) {
db.message().deleteMessage(uidl.id); EntityLog.log(context, account.name + " POP purging uidl=" + uidl.uidl);
} db.message().deleteMessage(uidl.id);
}
} else { } else {
Map<String, TupleUidl> known = new HashMap<>(); Map<String, TupleUidl> known = new HashMap<>();
for (TupleUidl id : ids) for (TupleUidl id : ids)
@ -3037,10 +3038,11 @@ class Core {
known.remove(msgid); known.remove(msgid);
} }
for (TupleUidl uidl : known.values()) { for (TupleUidl uidl : known.values())
EntityLog.log(context, account.name + " POP purging msgid=" + uidl.msgid); if (!uidl.ui_flagged) {
db.message().deleteMessage(uidl.id); EntityLog.log(context, account.name + " POP purging msgid=" + uidl.msgid);
} db.message().deleteMessage(uidl.id);
}
} }
} }

@ -651,7 +651,7 @@ public interface DaoMessage {
" AND NOT uid IS NULL") " AND NOT uid IS NULL")
List<Long> getBusyUids(long folder, long time); List<Long> getBusyUids(long folder, long time);
@Query("SELECT id, uidl, msgid, thread, ui_hide, ui_busy FROM message" + @Query("SELECT id, uidl, msgid, ui_hide, ui_busy, ui_flagged FROM message" +
" WHERE folder = :folder") " WHERE folder = :folder")
List<TupleUidl> getUidls(long folder); List<TupleUidl> getUidls(long folder);

@ -23,7 +23,7 @@ public class TupleUidl {
long id; long id;
String uidl; String uidl;
String msgid; String msgid;
String thread;
boolean ui_hide; boolean ui_hide;
Long ui_busy; Long ui_busy;
boolean ui_flagged;
} }

Loading…
Cancel
Save