Cloud sync: swipe left/right

This commit is contained in:
M66B 2023-01-18 18:34:33 +01:00
parent 693bb27e9a
commit 41e9935c88
3 changed files with 14 additions and 2847 deletions

File diff suppressed because it is too large Load Diff

View File

@ -193,7 +193,7 @@ public class CloudSync {
Helper.writeText(ifile, identity.toJSON().toString());
long itime = ifile.lastModified();
if (last == null || itime > last)
if (itime > last)
last = itime;
}
}
@ -316,15 +316,25 @@ public class CloudSync {
JSONObject jaccountdata = new JSONObject(value);
JSONObject jaccount = jaccountdata.getJSONObject("account");
JSONArray jidentities = jaccountdata.getJSONArray("identities");
EntityAccount raccount = EntityAccount.fromJSON(jaccount);
EntityAccount laccount = db.account().getAccountByUUID(raccount.uuid);
JSONArray jidentities = jaccountdata.getJSONArray("identities");
String swipe_left_folder = null;
if (jaccount.has("swipe_left_folder") && !jaccount.isNull("swipe_left_folder"))
swipe_left_folder = jaccount.getString("swipe_left_folder");
String swipe_right_folder = null;
if (jaccount.has("swipe_right_folder") && !jaccount.isNull("swipe_right_folder"))
swipe_right_folder = jaccount.getString("swipe_right_folder");
Log.i("Cloud account " + raccount.uuid + "=" +
(laccount == null ? "insert" :
(EntityAccount.areEqual(raccount, laccount, laccount.auth_type == ServiceAuthenticator.AUTH_TYPE_PASSWORD, true)
? "equal" : "update")) +
" rev=" + revision +
" left=" + swipe_left_folder +
" right=" + swipe_right_folder +
" identities=" + jidentities +
" size=" + value.length());

View File

@ -68,7 +68,7 @@ import javax.mail.internet.InternetAddress;
// https://developer.android.com/topic/libraries/architecture/room.html
@Database(
version = 262,
version = 261,
entities = {
EntityIdentity.class,
EntityAccount.class,
@ -2644,7 +2644,7 @@ public abstract class DB extends RoomDatabase {
else
db.execSQL("UPDATE `folder` SET `hide_seen` = 0");
}
}).addMigrations(new Migration(261, 262) {
}).addMigrations(new Migration(262, 261) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase db) {
logMigration(startVersion, endVersion);