Auto reload folder list

pull/215/head
M66B 6 months ago
parent ed9575e358
commit 063702814e

@ -787,20 +787,20 @@ public class EntityOperation {
sync(context, fid, false, force); sync(context, fid, false, force);
} }
static void sync(Context context, long fid, boolean foreground) { static boolean sync(Context context, long fid, boolean foreground) {
sync(context, fid, foreground, false); return sync(context, fid, foreground, false);
} }
static void sync(Context context, long fid, boolean foreground, boolean force) { static boolean sync(Context context, long fid, boolean foreground, boolean force) {
sync(context, fid, foreground, force, false); return sync(context, fid, foreground, force, false);
} }
static void sync(Context context, long fid, boolean foreground, boolean force, boolean outbox) { static boolean sync(Context context, long fid, boolean foreground, boolean force, boolean outbox) {
DB db = DB.getInstance(context); DB db = DB.getInstance(context);
EntityFolder folder = db.folder().getFolder(fid); EntityFolder folder = db.folder().getFolder(fid);
if (folder == null) if (folder == null)
return; return force;
if (foreground) { if (foreground) {
long now = new Date().getTime(); long now = new Date().getTime();
@ -864,6 +864,8 @@ public class EntityOperation {
Log.e("outbox"); Log.e("outbox");
ServiceSend.start(context); ServiceSend.start(context);
} }
return force;
} }
static void subscribe(Context context, long fid, boolean subscribe) { static void subscribe(Context context, long fid, boolean subscribe) {

@ -549,7 +549,8 @@ public class FragmentFolders extends FragmentBase {
Collections.sort(folders, folders.get(0).getComparator(context)); Collections.sort(folders, folders.get(0).getComparator(context));
for (EntityFolder folder : folders) { for (EntityFolder folder : folders) {
EntityOperation.sync(context, folder.id, true, force); if (EntityOperation.sync(context, folder.id, true, force))
reload = true;
if (folder.account == null) if (folder.account == null)
outbox = true; outbox = true;

Loading…
Cancel
Save