1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-31 20:25:38 +00:00

Export/import account/folder order

This commit is contained in:
M66B 2019-06-13 22:08:43 +02:00
parent 3c2878c1bf
commit 5e54bc0c6a
2 changed files with 9 additions and 0 deletions

View file

@ -141,6 +141,7 @@ public class EntityAccount extends EntityOrder implements Serializable {
public JSONObject toJSON() throws JSONException {
JSONObject json = new JSONObject();
json.put("id", id);
json.put("order", order);
json.put("auth_type", auth_type);
json.put("host", host);
json.put("starttls", starttls);
@ -173,6 +174,10 @@ public class EntityAccount extends EntityOrder implements Serializable {
public static EntityAccount fromJSON(JSONObject json) throws JSONException {
EntityAccount account = new EntityAccount();
// id
if (json.has("order"))
account.order = json.getInt("order");
account.auth_type = json.getInt("auth_type");
account.host = json.getString("host");
account.starttls = (json.has("starttls") && json.getBoolean("starttls"));

View file

@ -312,6 +312,7 @@ public class EntityFolder extends EntityOrder implements Serializable {
public JSONObject toJSON() throws JSONException {
JSONObject json = new JSONObject();
json.put("id", id);
json.put("order", order);
json.put("name", name);
json.put("type", type);
json.put("synchronize", synchronize);
@ -333,6 +334,9 @@ public class EntityFolder extends EntityOrder implements Serializable {
if (json.has("id"))
folder.id = json.getLong("id");
if (json.has("order"))
folder.order = json.getInt("order");
folder.name = json.getString("name");
folder.type = json.getString("type");