Fetch after move only if folder disabled or no idle

This commit is contained in:
M66B 2019-09-27 15:32:29 +02:00
parent 1c4e267fcb
commit 774f97819d
1 changed files with 15 additions and 13 deletions

View File

@ -720,22 +720,24 @@ class Core {
ifolder.expunge();
}
// Fetch appended/copied
try {
itarget.open(READ_WRITE);
// Fetch appended/copied when needed
if (!TextUtils.isEmpty(message.msgid) &&
(!folder.synchronize || !istore.hasCapability("IDLE")))
try {
Long uid = findUid(itarget, message.msgid, false);
if (uid != null) {
JSONArray fargs = new JSONArray();
fargs.put(uid);
onFetch(context, fargs, target, itarget, state);
itarget.open(READ_WRITE);
try {
Long uid = findUid(itarget, message.msgid, false);
if (uid != null) {
JSONArray fargs = new JSONArray();
fargs.put(uid);
onFetch(context, fargs, target, itarget, state);
}
} finally {
itarget.close();
}
} finally {
itarget.close();
} catch (Throwable ex) {
Log.w(ex);
}
} catch (Throwable ex) {
Log.w(ex);
}
// Delete junk contacts
if (EntityFolder.JUNK.equals(target.type)) {