Add ability to hide contacts behind a feature flag.

This commit is contained in:
Alex Hart
2022-09-27 16:40:27 -03:00
committed by Cody Henthorne
parent a8a773db43
commit 04eeb434c9
19 changed files with 511 additions and 45 deletions

View File

@@ -133,6 +133,10 @@ public final class SignalContactRecord implements SignalRecord {
diff.add("UnregisteredTimestamp");
}
if (isHidden() != that.isHidden()) {
diff.add("Hidden");
}
if (!Objects.equals(this.hasUnknownFields(), that.hasUnknownFields())) {
diff.add("UnknownFields");
}
@@ -215,6 +219,10 @@ public final class SignalContactRecord implements SignalRecord {
return proto.getUnregisteredAtTimestamp();
}
public boolean isHidden() {
return proto.getHidden();
}
/**
* Returns the same record, but stripped of the PNI field. Only used while PNP is in development.
*/
@@ -331,6 +339,11 @@ public final class SignalContactRecord implements SignalRecord {
return this;
}
public Builder setHidden(boolean hidden) {
builder.setHidden(hidden);
return this;
}
private static ContactRecord.Builder parseUnknowns(byte[] serializedUnknowns) {
try {
return ContactRecord.parseFrom(serializedUnknowns).toBuilder();

View File

@@ -87,7 +87,8 @@ message ContactRecord {
uint64 mutedUntilTimestamp = 13;
bool hideStory = 14;
uint64 unregisteredAtTimestamp = 16;
// NEXT ID: 17
bool hidden = 19;
// NEXT ID: 20
}
message GroupV1Record {