mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 20:54:34 +00:00
Cloud sync: prevent constraint violation
This commit is contained in:
parent
2b0dcffc2a
commit
99da99dfb9
1 changed files with 18 additions and 10 deletions
|
@ -448,19 +448,27 @@ public class CloudSync {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (left != null) {
|
if (left != null) {
|
||||||
left.account = raccount.id;
|
EntityFolder existing = db.folder().getFolderByName(raccount.id, left.name);
|
||||||
left.setProperties();
|
if (existing == null) {
|
||||||
left.setSpecials(raccount);
|
left.account = raccount.id;
|
||||||
left.id = db.folder().insertFolder(left);
|
left.setProperties();
|
||||||
raccount.swipe_left = left.id;
|
left.setSpecials(raccount);
|
||||||
|
left.id = db.folder().insertFolder(left);
|
||||||
|
raccount.swipe_left = left.id;
|
||||||
|
} else
|
||||||
|
raccount.swipe_left = existing.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (right != null) {
|
if (right != null) {
|
||||||
right.account = raccount.id;
|
EntityFolder existing = db.folder().getFolderByName(raccount.id, right.name);
|
||||||
right.setProperties();
|
if (existing == null) {
|
||||||
right.setSpecials(raccount);
|
right.account = raccount.id;
|
||||||
right.id = db.folder().insertFolder(right);
|
right.setProperties();
|
||||||
raccount.swipe_right = right.id;
|
right.setSpecials(raccount);
|
||||||
|
right.id = db.folder().insertFolder(right);
|
||||||
|
raccount.swipe_right = right.id;
|
||||||
|
} else
|
||||||
|
raccount.swipe_right = existing.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
db.account().setAccountSwipes(raccount.id, raccount.swipe_left, raccount.swipe_right);
|
db.account().setAccountSwipes(raccount.id, raccount.swipe_left, raccount.swipe_right);
|
||||||
|
|
Loading…
Reference in a new issue