Fixed fetch on move

This commit is contained in:
M66B 2020-01-17 10:22:36 +01:00
parent ddd85f4244
commit 8aee5a6706
1 changed files with 7 additions and 2 deletions

View File

@ -867,9 +867,14 @@ class Core {
ifolder.expunge(); ifolder.expunge();
} }
boolean fetch =
(!target.synchronize || !"connected".equals(target.state) ||
target.poll || !istore.hasCapability("IDLE"));
// Fetch appended/copied when needed // Fetch appended/copied when needed
if (draft || !target.synchronize || target.poll || !istore.hasCapability("IDLE")) if (draft || fetch)
try { try {
Log.i(target.name + " moved message fetch=" + fetch);
itarget.open(READ_WRITE); itarget.open(READ_WRITE);
for (EntityMessage message : map.values()) for (EntityMessage message : map.values())
@ -892,7 +897,7 @@ class Core {
icopy.setFlag(Flags.Flag.DRAFT, EntityFolder.DRAFTS.equals(target.type)); icopy.setFlag(Flags.Flag.DRAFT, EntityFolder.DRAFTS.equals(target.type));
} }
if (!target.synchronize || !istore.hasCapability("IDLE")) { if (fetch) {
JSONArray fargs = new JSONArray(); JSONArray fargs = new JSONArray();
fargs.put(uid); fargs.put(uid);
onFetch(context, fargs, target, istore, itarget, state); onFetch(context, fargs, target, istore, itarget, state);