Fixed importing answers

This commit is contained in:
M66B 2020-01-24 16:30:16 +01:00
parent c602570001
commit 6a6be0c5a5
1 changed files with 3 additions and 1 deletions

View File

@ -102,6 +102,7 @@ public class EntityAnswer implements Serializable {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("id", id); json.put("id", id);
json.put("name", name); json.put("name", name);
json.put("favorite", favorite);
json.put("hide", hide); json.put("hide", hide);
json.put("text", text); json.put("text", text);
return json; return json;
@ -111,7 +112,8 @@ public class EntityAnswer implements Serializable {
EntityAnswer answer = new EntityAnswer(); EntityAnswer answer = new EntityAnswer();
answer.id = json.getLong("id"); answer.id = json.getLong("id");
answer.name = json.getString("name"); answer.name = json.getString("name");
answer.hide = (json.has("hide") && json.getBoolean("hide")); answer.favorite = json.optBoolean("favorite");
answer.hide = json.optBoolean("hide");
answer.text = json.getString("text"); answer.text = json.getString("text");
return answer; return answer;
} }