mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-15 23:31:55 +00:00
GV2 storage service syncing.
This commit is contained in:
committed by
Greyson Parrelli
parent
36df3f234f
commit
11d17f7496
@@ -69,7 +69,7 @@ public final class SignalGroupV2Record implements SignalRecord {
|
||||
private final GroupV2Record.Builder builder;
|
||||
|
||||
public Builder(byte[] rawId, GroupMasterKey masterKey) {
|
||||
this.id = StorageId.forGroupV1(rawId);
|
||||
this.id = StorageId.forGroupV2(rawId);
|
||||
this.builder = GroupV2Record.newBuilder();
|
||||
|
||||
builder.setMasterKey(ByteString.copyFrom(masterKey.serialize()));
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.util.Objects;
|
||||
|
||||
public class SignalStorageRecord implements SignalRecord {
|
||||
|
||||
private final StorageId id;
|
||||
private final StorageId id;
|
||||
private final Optional<SignalContactRecord> contact;
|
||||
private final Optional<SignalGroupV1Record> groupV1;
|
||||
private final Optional<SignalGroupV2Record> groupV2;
|
||||
@@ -88,7 +88,7 @@ public class SignalStorageRecord implements SignalRecord {
|
||||
}
|
||||
|
||||
public boolean isUnknown() {
|
||||
return !contact.isPresent() && !groupV1.isPresent() && !account.isPresent();
|
||||
return !contact.isPresent() && !groupV1.isPresent() && !groupV2.isPresent() && !account.isPresent();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -97,12 +97,13 @@ public class SignalStorageRecord implements SignalRecord {
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
SignalStorageRecord that = (SignalStorageRecord) o;
|
||||
return Objects.equals(id, that.id) &&
|
||||
Objects.equals(contact, that.contact) &&
|
||||
Objects.equals(groupV1, that.groupV1);
|
||||
Objects.equals(contact, that.contact) &&
|
||||
Objects.equals(groupV1, that.groupV1) &&
|
||||
Objects.equals(groupV2, that.groupV2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, contact, groupV1);
|
||||
return Objects.hash(id, contact, groupV1, groupV2);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user