mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-28 12:44:34 +01:00
Move capabilities into a single column.
This commit is contained in:
committed by
Alan Evans
parent
ead64d92a5
commit
3357475fc4
@@ -97,7 +97,6 @@ public class Recipient {
|
||||
private final String notificationChannel;
|
||||
private final UnidentifiedAccessMode unidentifiedAccessMode;
|
||||
private final boolean forceSmsSelection;
|
||||
private final Capability uuidCapability;
|
||||
private final Capability groupsV2Capability;
|
||||
private final InsightsBannerTier insightsBannerTier;
|
||||
private final byte[] storageId;
|
||||
@@ -311,7 +310,6 @@ public class Recipient {
|
||||
this.notificationChannel = null;
|
||||
this.unidentifiedAccessMode = UnidentifiedAccessMode.DISABLED;
|
||||
this.forceSmsSelection = false;
|
||||
this.uuidCapability = Capability.UNKNOWN;
|
||||
this.groupsV2Capability = Capability.UNKNOWN;
|
||||
this.storageId = null;
|
||||
this.mentionSetting = MentionSetting.ALWAYS_NOTIFY;
|
||||
@@ -353,7 +351,6 @@ public class Recipient {
|
||||
this.notificationChannel = details.notificationChannel;
|
||||
this.unidentifiedAccessMode = details.unidentifiedAccessMode;
|
||||
this.forceSmsSelection = details.forceSmsSelection;
|
||||
this.uuidCapability = details.uuidCapability;
|
||||
this.groupsV2Capability = details.groupsV2Capability;
|
||||
this.storageId = details.storageId;
|
||||
this.mentionSetting = details.mentionSetting;
|
||||
@@ -740,25 +737,10 @@ public class Recipient {
|
||||
return forceSmsSelection;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return True if this recipient can support receiving UUID-only messages, otherwise false.
|
||||
*/
|
||||
public boolean isUuidSupported() {
|
||||
if (FeatureFlags.usernames()) {
|
||||
return true;
|
||||
} else {
|
||||
return uuidCapability == Capability.SUPPORTED;
|
||||
}
|
||||
}
|
||||
|
||||
public Capability getGroupsV2Capability() {
|
||||
return groupsV2Capability;
|
||||
}
|
||||
|
||||
public Capability getUuidCapability() {
|
||||
return uuidCapability;
|
||||
}
|
||||
|
||||
public @Nullable byte[] getProfileKey() {
|
||||
return profileKey;
|
||||
}
|
||||
@@ -825,7 +807,7 @@ public class Recipient {
|
||||
public enum Capability {
|
||||
UNKNOWN(0),
|
||||
SUPPORTED(1),
|
||||
NOT_SUPPORTED(-1);
|
||||
NOT_SUPPORTED(2);
|
||||
|
||||
private final int value;
|
||||
|
||||
@@ -839,9 +821,10 @@ public class Recipient {
|
||||
|
||||
public static Capability deserialize(int value) {
|
||||
switch (value) {
|
||||
case 1 : return SUPPORTED;
|
||||
case -1 : return NOT_SUPPORTED;
|
||||
default : return UNKNOWN;
|
||||
case 0: return UNKNOWN;
|
||||
case 1: return SUPPORTED;
|
||||
case 2: return NOT_SUPPORTED;
|
||||
default: throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,6 @@ public class RecipientDetails {
|
||||
final String notificationChannel;
|
||||
final UnidentifiedAccessMode unidentifiedAccessMode;
|
||||
final boolean forceSmsSelection;
|
||||
final Recipient.Capability uuidCapability;
|
||||
final Recipient.Capability groupsV2Capability;
|
||||
final InsightsBannerTier insightsBannerTier;
|
||||
final byte[] storageId;
|
||||
@@ -104,7 +103,6 @@ public class RecipientDetails {
|
||||
this.notificationChannel = settings.getNotificationChannel();
|
||||
this.unidentifiedAccessMode = settings.getUnidentifiedAccessMode();
|
||||
this.forceSmsSelection = settings.isForceSmsSelection();
|
||||
this.uuidCapability = settings.getUuidCapability();
|
||||
this.groupsV2Capability = settings.getGroupsV2Capability();
|
||||
this.insightsBannerTier = settings.getInsightsBannerTier();
|
||||
this.storageId = settings.getStorageId();
|
||||
@@ -152,7 +150,6 @@ public class RecipientDetails {
|
||||
this.unidentifiedAccessMode = UnidentifiedAccessMode.UNKNOWN;
|
||||
this.forceSmsSelection = false;
|
||||
this.name = null;
|
||||
this.uuidCapability = Recipient.Capability.UNKNOWN;
|
||||
this.groupsV2Capability = Recipient.Capability.UNKNOWN;
|
||||
this.storageId = null;
|
||||
this.mentionSetting = MentionSetting.ALWAYS_NOTIFY;
|
||||
|
||||
Reference in New Issue
Block a user