Restore orphan POP3 moves

pull/208/head
M66B 3 years ago
parent 06e84bac7f
commit 4746ede5f0

@ -2961,17 +2961,11 @@ class Core {
msgid + "=" + msgIdTuple.containsKey(msgid) + "/" + msgid + "=" + msgIdTuple.containsKey(msgid) + "/" +
uidl + "=" + uidlTuple.containsKey(uidl)); uidl + "=" + uidlTuple.containsKey(uidl));
if (tuple.ui_hide) { // Restore orphan POP3 moves
boolean found = false; if (tuple.ui_hide &&
List<EntityMessage> threaded = db.message().getMessagesByThread(account.id, tuple.thread, null, null); tuple.ui_busy != null &&
for (EntityMessage m : threaded) tuple.ui_busy < new Date().getTime())
if (!m.folder.equals(folder.id) && m.received > 1654034400 /* 2022-06-01 */) { db.message().setMessageUiHide(tuple.id, false);
found = true;
break;
}
if (!found)
db.message().setMessageUiHide(tuple.id, false);
}
if (download_eml) if (download_eml)
try { try {

@ -638,7 +638,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 FROM message" + @Query("SELECT id, uidl, msgid, thread, ui_hide, ui_busy FROM message" +
" WHERE folder = :folder") " WHERE folder = :folder")
List<TupleUidl> getUidls(long folder); List<TupleUidl> getUidls(long folder);

@ -25,4 +25,5 @@ public class TupleUidl {
String msgid; String msgid;
String thread; String thread;
boolean ui_hide; boolean ui_hide;
Long ui_busy;
} }

Loading…
Cancel
Save