Simplify storing storage-service-specific recipient values.

This gives us the ability to separate things we need for the Recipient
class from things we only need for storage syncing.

Not only does this simplify the storage service model building code
(i.e. we no longer need to pass around a set of archived recipients),
but it also eliminates a join on the Identity table for building regular
recipients, which should help perf.
This commit is contained in:
Greyson Parrelli
2020-10-06 10:24:14 -04:00
parent 38fa58c0a3
commit e00397620a
11 changed files with 181 additions and 143 deletions

View File

@@ -102,8 +102,6 @@ public class Recipient {
private final Capability groupsV2Capability;
private final InsightsBannerTier insightsBannerTier;
private final byte[] storageId;
private final byte[] identityKey;
private final VerifiedStatus identityStatus;
private final MentionSetting mentionSetting;
@@ -317,8 +315,6 @@ public class Recipient {
this.uuidCapability = Capability.UNKNOWN;
this.groupsV2Capability = Capability.UNKNOWN;
this.storageId = null;
this.identityKey = null;
this.identityStatus = VerifiedStatus.DEFAULT;
this.mentionSetting = MentionSetting.ALWAYS_NOTIFY;
}
@@ -361,8 +357,6 @@ public class Recipient {
this.uuidCapability = details.uuidCapability;
this.groupsV2Capability = details.groupsV2Capability;
this.storageId = details.storageId;
this.identityKey = details.identityKey;
this.identityStatus = details.identityStatus;
this.mentionSetting = details.mentionSetting;
}
@@ -782,14 +776,6 @@ public class Recipient {
return storageId;
}
public @NonNull VerifiedStatus getIdentityVerifiedStatus() {
return identityStatus;
}
public @Nullable byte[] getIdentityKey() {
return identityKey;
}
public @NonNull UnidentifiedAccessMode getUnidentifiedAccessMode() {
return unidentifiedAccessMode;
}

View File

@@ -65,9 +65,7 @@ public class RecipientDetails {
final Recipient.Capability uuidCapability;
final Recipient.Capability groupsV2Capability;
final InsightsBannerTier insightsBannerTier;
final byte[] storageId;
final byte[] identityKey;
final VerifiedStatus identityStatus;
final byte[] storageId;
final MentionSetting mentionSetting;
public RecipientDetails(@Nullable String name,
@@ -113,8 +111,6 @@ public class RecipientDetails {
this.groupsV2Capability = settings.getGroupsV2Capability();
this.insightsBannerTier = settings.getInsightsBannerTier();
this.storageId = settings.getStorageId();
this.identityKey = settings.getIdentityKey();
this.identityStatus = settings.getIdentityStatus();
this.mentionSetting = settings.getMentionSetting();
if (name == null) this.name = settings.getSystemDisplayName();
@@ -162,8 +158,6 @@ public class RecipientDetails {
this.uuidCapability = Recipient.Capability.UNKNOWN;
this.groupsV2Capability = Recipient.Capability.UNKNOWN;
this.storageId = null;
this.identityKey = null;
this.identityStatus = VerifiedStatus.DEFAULT;
this.mentionSetting = MentionSetting.ALWAYS_NOTIFY;
}