diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountBadge.java b/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountBadge.java index 08d696ce8..4de2547c1 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountBadge.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/storage/AccountBadge.java @@ -14,13 +14,16 @@ public class AccountBadge { private final String name; private final Instant expiration; + private final boolean visible; @JsonCreator public AccountBadge( @JsonProperty("name") String name, - @JsonProperty("expiration") Instant expiration) { + @JsonProperty("expiration") Instant expiration, + @JsonProperty("visible") boolean visible) { this.name = name; this.expiration = expiration; + this.visible = visible; } public String getName() { @@ -31,6 +34,10 @@ public class AccountBadge { return expiration; } + public boolean isVisible() { + return visible; + } + @Override public boolean equals(final Object o) { if (this == o) { @@ -40,13 +47,13 @@ public class AccountBadge { return false; } AccountBadge that = (AccountBadge) o; - return Objects.equals(name, that.name) + return visible == that.visible && Objects.equals(name, that.name) && Objects.equals(expiration, that.expiration); } @Override public int hashCode() { - return Objects.hash(name, expiration); + return Objects.hash(name, expiration, visible); } @Override @@ -54,6 +61,7 @@ public class AccountBadge { return "AccountBadge{" + "name='" + name + '\'' + ", expiration=" + expiration + + ", visible=" + visible + '}'; } }