Sqash ADD operations

This commit is contained in:
M66B 2019-04-04 15:21:55 +02:00
parent ad1644bf68
commit 6fbdac338a
1 changed files with 16 additions and 1 deletions

View File

@ -166,7 +166,22 @@ class Core {
break; break;
case EntityOperation.ADD: case EntityOperation.ADD:
onAdd(context, jargs, folder, message, isession, (IMAPStore) istore, (IMAPFolder) ifolder); boolean squash = false;
for (int j = i + 1; j < ops.size(); j++) {
EntityOperation next = ops.get(j);
if (next.message != null && next.message.equals(op.message) &&
(EntityOperation.ADD.equals(next.name) || EntityOperation.DELETE.equals(next.name))) {
squash = true;
break;
}
}
if (squash)
Log.i(folder.name +
" squashing op=" + op.id + "/" + op.name +
" msg=" + op.message +
" args=" + op.args);
else
onAdd(context, jargs, folder, message, isession, (IMAPStore) istore, (IMAPFolder) ifolder);
break; break;
case EntityOperation.MOVE: case EntityOperation.MOVE: