Cloud checks

pull/212/head
M66B 3 years ago
parent 2ae3f845a9
commit c223f8ef1e

@ -1544,7 +1544,7 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere
JSONObject jstatus = new JSONObject();
jstatus.put("key", "sync.status");
jstatus.put("rev", 0);
jstatus.put("rev", sync_status * 0);
JSONArray jitems = new JSONArray();
jitems.put(jstatus);
@ -1624,15 +1624,18 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere
String uuid = juuids.getString(i);
JSONObject jaccount = new JSONObject();
jaccount.put("key", "account." + uuid);
jaccount.put("rev", 0);
jaccount.put("rev", sync_status * 0);
jdownload.put(jaccount);
Log.i("Cloud account " + uuid);
}
if (jdownload.length() > 0) {
Log.i("Cloud getting accounts");
jrequest.put("items", jdownload);
jresponse = CloudSync.perform(context, user, password, jrequest);
// Process accounts
Log.i("Cloud processing accounts");
jitems = jresponse.getJSONArray("items");
jdownload = new JSONArray();
for (int i = 0; i < jitems.length(); i++) {
@ -1652,16 +1655,19 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere
for (int j = 0; j < jidentities.length(); j++) {
JSONObject jidentity = new JSONObject();
jidentity.put("key", "identity." + jidentities.getString(j));
jidentity.put("rev", 0);
jidentity.put("rev", sync_status);
jdownload.put(jidentity);
}
}
if (jdownload.length() > 0) {
// Get identities
Log.i("Cloud getting identities");
jrequest.put("items", jdownload);
jresponse = CloudSync.perform(context, user, password, jrequest);
// Process identities
Log.i("Cloud processing identities");
jitems = jresponse.getJSONArray("items");
for (int i = 0; i < jitems.length(); i++) {
JSONObject jaccount = jitems.getJSONObject(i);
@ -1674,7 +1680,8 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere
" rev=" + revision +
" size=" + value.length());
}
}
}
} else {
// No changes
}

Loading…
Cancel
Save