Versioned Profiles support (disabled).

This commit is contained in:
Alan Evans
2020-02-10 18:40:22 -05:00
committed by Greyson Parrelli
parent f10d1eac61
commit 7ecb50a3fe
67 changed files with 1200 additions and 321 deletions

View File

@@ -78,6 +78,7 @@ public class Recipient {
private final int expireMessages;
private final RegisteredState registered;
private final byte[] profileKey;
private final byte[] profileKeyCredential;
private final String name;
private final Uri systemContactPhoto;
private final String customLabel;
@@ -297,6 +298,7 @@ public class Recipient {
this.expireMessages = 0;
this.registered = RegisteredState.UNKNOWN;
this.profileKey = null;
this.profileKeyCredential = null;
this.name = null;
this.systemContactPhoto = null;
this.customLabel = null;
@@ -336,6 +338,7 @@ public class Recipient {
this.expireMessages = details.expireMessages;
this.registered = details.registered;
this.profileKey = details.profileKey;
this.profileKeyCredential = details.profileKeyCredential;
this.name = details.name;
this.systemContactPhoto = details.systemContactPhoto;
this.customLabel = details.customLabel;
@@ -666,6 +669,14 @@ public class Recipient {
return profileKey;
}
public @Nullable byte[] getProfileKeyCredential() {
return profileKeyCredential;
}
public boolean hasProfileKeyCredential() {
return profileKeyCredential != null;
}
public @Nullable byte[] getStorageServiceKey() {
return storageKey;
}

View File

@@ -47,6 +47,7 @@ public class RecipientDetails {
final Optional<Integer> defaultSubscriptionId;
final RegisteredState registered;
final byte[] profileKey;
final byte[] profileKeyCredential;
final String profileAvatar;
final boolean profileSharing;
final boolean systemContact;
@@ -90,6 +91,7 @@ public class RecipientDetails {
this.defaultSubscriptionId = settings.getDefaultSubscriptionId();
this.registered = settings.getRegistered();
this.profileKey = settings.getProfileKey();
this.profileKeyCredential = settings.getProfileKeyCredential();
this.profileAvatar = settings.getProfileAvatar();
this.profileSharing = settings.isProfileSharing();
this.systemContact = systemContact;
@@ -134,6 +136,7 @@ public class RecipientDetails {
this.defaultSubscriptionId = Optional.absent();
this.registered = RegisteredState.UNKNOWN;
this.profileKey = null;
this.profileKeyCredential = null;
this.profileAvatar = null;
this.profileSharing = false;
this.systemContact = true;