mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 03:46:00 +01:00
Added answer stats
This commit is contained in:
@@ -59,6 +59,9 @@ public class EntityAnswer implements Serializable {
|
||||
public Boolean hide;
|
||||
@NonNull
|
||||
public String text;
|
||||
@NonNull
|
||||
public Integer applied = 0;
|
||||
public Long last_applied;
|
||||
|
||||
String getText(Address[] address) {
|
||||
return replacePlaceholders(text, address);
|
||||
@@ -128,6 +131,8 @@ public class EntityAnswer implements Serializable {
|
||||
json.put("favorite", favorite);
|
||||
json.put("hide", hide);
|
||||
json.put("text", text);
|
||||
json.put("applied", applied);
|
||||
json.put("last_applied", last_applied);
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -141,6 +146,9 @@ public class EntityAnswer implements Serializable {
|
||||
answer.favorite = json.optBoolean("favorite");
|
||||
answer.hide = json.optBoolean("hide");
|
||||
answer.text = json.getString("text");
|
||||
answer.applied = json.optInt("applied", 0);
|
||||
if (json.has("last_applied") && !json.isNull("last_applied"))
|
||||
answer.last_applied = json.getLong("last_applied");
|
||||
return answer;
|
||||
}
|
||||
|
||||
@@ -154,8 +162,9 @@ public class EntityAnswer implements Serializable {
|
||||
this.receipt.equals(other.receipt) &&
|
||||
this.favorite.equals(other.favorite) &&
|
||||
this.hide.equals(other.hide) &&
|
||||
this.text.equals(other.text)
|
||||
);
|
||||
this.text.equals(other.text) &&
|
||||
this.applied.equals(other.applied) &&
|
||||
Objects.equals(this.last_applied, other.last_applied));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user