|
|
|
@ -3289,7 +3289,8 @@ class Core {
|
|
|
|
|
ifolder.fetch(imessages, ifetch);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!account.leave_on_device) {
|
|
|
|
|
long now = new Date().getTime();
|
|
|
|
|
|
|
|
|
|
if (hasUidl) {
|
|
|
|
|
Map<String, TupleUidl> known = new HashMap<>();
|
|
|
|
|
for (TupleUidl id : ids)
|
|
|
|
@ -3305,8 +3306,11 @@ class Core {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (TupleUidl uidl : known.values())
|
|
|
|
|
if (!uidl.ui_flagged) {
|
|
|
|
|
EntityLog.log(context, account.name + " POP purging uidl=" + uidl.uidl);
|
|
|
|
|
if (!uidl.ui_flagged &&
|
|
|
|
|
(!account.leave_on_device ||
|
|
|
|
|
(uidl.ui_hide && (uidl.ui_busy == null || uidl.ui_busy < now)))) {
|
|
|
|
|
EntityLog.log(context, account.name + " POP purging" +
|
|
|
|
|
" uidl=" + uidl.uidl + " hidden=" + uidl.ui_hide);
|
|
|
|
|
db.message().deleteMessage(uidl.id);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
@ -3323,12 +3327,14 @@ class Core {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (TupleUidl uidl : known.values())
|
|
|
|
|
if (!uidl.ui_flagged) {
|
|
|
|
|
EntityLog.log(context, account.name + " POP purging msgid=" + uidl.msgid);
|
|
|
|
|
if (!uidl.ui_flagged &&
|
|
|
|
|
(!account.leave_on_device ||
|
|
|
|
|
(uidl.ui_hide && (uidl.ui_busy == null || uidl.ui_busy < now)))) {
|
|
|
|
|
EntityLog.log(context, account.name + " POP purging" +
|
|
|
|
|
" msgid=" + uidl.msgid + " hidden=" + uidl.ui_hide);
|
|
|
|
|
db.message().deleteMessage(uidl.id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
boolean _new = true;
|
|
|
|
|
for (int i = reversed ? 0 : imessages.length - 1; reversed ? i < max : i >= imessages.length - max; i += reversed ? 1 : -1) {
|
|
|
|
|