Add support for new group story display states.

This commit is contained in:
Alex Hart
2022-09-22 13:21:53 -03:00
committed by Cody Henthorne
parent 8ca94eb3d5
commit c47a724654
16 changed files with 211 additions and 63 deletions

View File

@@ -82,6 +82,10 @@ public final class SignalGroupV2Record implements SignalRecord {
diff.add("HideStory");
}
if (!Objects.equals(this.getStorySendMode(), that.getStorySendMode())) {
diff.add("StorySendMode");
}
if (!Objects.equals(this.hasUnknownFields(), that.hasUnknownFields())) {
diff.add("UnknownFields");
}
@@ -140,6 +144,10 @@ public final class SignalGroupV2Record implements SignalRecord {
return proto.getHideStory();
}
public GroupV2Record.StorySendMode getStorySendMode() {
return proto.getStorySendMode();
}
public GroupV2Record toProto() {
return proto;
}
@@ -213,6 +221,11 @@ public final class SignalGroupV2Record implements SignalRecord {
return this;
}
public Builder setStorySendMode(GroupV2Record.StorySendMode storySendMode) {
builder.setStorySendMode(storySendMode);
return this;
}
private static GroupV2Record.Builder parseUnknowns(byte[] serializedUnknowns) {
try {
return GroupV2Record.parseFrom(serializedUnknowns).toBuilder();

View File

@@ -100,14 +100,22 @@ message GroupV1Record {
}
message GroupV2Record {
bytes masterKey = 1;
bool blocked = 2;
bool whitelisted = 3;
bool archived = 4;
bool markedUnread = 5;
uint64 mutedUntilTimestamp = 6;
bool dontNotifyForMentionsIfMuted = 7;
bool hideStory = 8;
enum StorySendMode {
DEFAULT = 0;
DISABLED = 1;
ENABLED = 2;
}
bytes masterKey = 1;
bool blocked = 2;
bool whitelisted = 3;
bool archived = 4;
bool markedUnread = 5;
uint64 mutedUntilTimestamp = 6;
bool dontNotifyForMentionsIfMuted = 7;
bool hideStory = 8;
reserved /* storySendEnabled */ 9;
StorySendMode storySendMode = 10;
}
message Payments {