Simplifications

pull/149/head
M66B 6 years ago
parent 77e38e0a94
commit 81235592e3

@ -301,9 +301,8 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
db.beginTransaction(); db.beginTransaction();
boolean now; boolean now;
if (aid < 0) { if (aid < 0) { // outbox
// outbox now = "connected".equals(folder.state);
now = (internet && "connected".equals(folder.state));
EntityOperation.sync(db, fid); EntityOperation.sync(db, fid);
} else { } else {
if (!internet || "connected".equals(db.account().getAccount(aid).state)) { if (!internet || "connected".equals(db.account().getAccount(aid).state)) {
@ -311,7 +310,6 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
EntityOperation.sync(db, fid); EntityOperation.sync(db, fid);
} else { } else {
now = true; now = true;
db.folder().setFolderSyncState(folder.id, "requested");
ServiceSynchronize.sync(context, fid); ServiceSynchronize.sync(context, fid);
} }
} }

@ -515,7 +515,7 @@ public class FragmentMessages extends FragmentBase {
boolean now = false; boolean now = false;
for (EntityFolder folder : folders) for (EntityFolder folder : folders)
if (folder.account == null) { // outbox if (folder.account == null) { // outbox
now = (internet && "connected".equals(folder.state)); now = "connected".equals(folder.state);
EntityOperation.sync(db, folder.id); EntityOperation.sync(db, folder.id);
} else { } else {
EntityAccount account = db.account().getAccount(folder.account); EntityAccount account = db.account().getAccount(folder.account);
@ -524,7 +524,6 @@ public class FragmentMessages extends FragmentBase {
EntityOperation.sync(db, folder.id); EntityOperation.sync(db, folder.id);
} else { } else {
now = true; now = true;
db.folder().setFolderSyncState(folder.id, "requested");
ServiceSynchronize.sync(context, folder.id); ServiceSynchronize.sync(context, folder.id);
} }
} }

Loading…
Cancel
Save