mirror of https://github.com/M66B/FairEmail.git
Fixed operation cross account ID
This commit is contained in:
parent
09dd97f814
commit
d3fca07fa1
|
@ -108,7 +108,7 @@ public class AdapterOperation extends RecyclerView.Adapter<AdapterOperation.View
|
|||
(operation.accountName == null ? "" : operation.accountName + "/") + operation.folderName;
|
||||
|
||||
ivState.setVisibility(operation.state == null ? View.INVISIBLE : View.VISIBLE);
|
||||
tvFolder.setText(folderName);
|
||||
tvFolder.setText(folderName + ":" + operation.folder);
|
||||
tvOperation.setText(sb.toString());
|
||||
tvTime.setText(Helper.getRelativeTimeSpanString(context, operation.created));
|
||||
tvError.setText(operation.error);
|
||||
|
|
|
@ -1076,12 +1076,16 @@ class Core {
|
|||
|
||||
if (jargs.length() > 0) {
|
||||
// Cross account move
|
||||
long target = jargs.getLong(0);
|
||||
Log.i(folder.name + " queuing ADD id=" + message.id + ":" + target);
|
||||
long tid = jargs.getLong(0);
|
||||
EntityFolder target = db.folder().getFolder(tid);
|
||||
if (target == null)
|
||||
throw new FolderNotFoundException();
|
||||
|
||||
Log.i(folder.name + " queuing ADD id=" + message.id + ":" + target.id);
|
||||
|
||||
EntityOperation operation = new EntityOperation();
|
||||
operation.account = message.account;
|
||||
operation.folder = target;
|
||||
operation.account = target.account;
|
||||
operation.folder = target.id;
|
||||
operation.message = message.id;
|
||||
operation.name = EntityOperation.ADD;
|
||||
operation.args = jargs.toString();
|
||||
|
|
|
@ -289,14 +289,15 @@ public class EntityOperation {
|
|||
}
|
||||
|
||||
// Cross account move
|
||||
long folder = source.id;
|
||||
if (!source.account.equals(target.account))
|
||||
if (message.raw != null && message.raw) {
|
||||
name = ADD;
|
||||
folder = target.id;
|
||||
} else
|
||||
name = RAW;
|
||||
queue(context, message.account, folder, message.id, name, jargs);
|
||||
if (source.account.equals(target.account))
|
||||
queue(context, message.account, source.id, message.id, name, jargs);
|
||||
else {
|
||||
if (message.raw != null && message.raw)
|
||||
queue(context, target.account, target.id, message.id, ADD, jargs);
|
||||
else
|
||||
queue(context, source.account, source.id, message.id, RAW, jargs);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
} else if (DELETE.equals(name))
|
||||
|
|
Loading…
Reference in New Issue