From bc887ec6fa985fa1d2b31496b69ab15108e153f4 Mon Sep 17 00:00:00 2001 From: Ehren Kret Date: Fri, 3 Sep 2021 15:33:15 -0500 Subject: [PATCH] Add visibility flag to badge storage --- .../textsecuregcm/storage/AccountBadge.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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 + '}'; } }