Add GV2 accept by PNI invite.

This commit is contained in:
Cody Henthorne
2022-07-11 15:20:00 -04:00
parent b223ebe95e
commit c4bef8099f
71 changed files with 1468 additions and 1016 deletions

View File

@@ -14,7 +14,7 @@ import com.annimon.stream.Stream;
import org.signal.core.util.StringUtil;
import org.signal.core.util.logging.Log;
import org.signal.libsignal.zkgroup.profiles.ProfileKeyCredential;
import org.signal.libsignal.zkgroup.profiles.ExpiringProfileKeyCredential;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.badges.models.Badge;
import org.thoughtcrime.securesms.contacts.avatars.ContactPhoto;
@@ -81,61 +81,61 @@ public class Recipient {
private static final int MAX_MEMBER_NAMES = 10;
private final RecipientId id;
private final boolean resolving;
private final ServiceId serviceId;
private final PNI pni;
private final String username;
private final String e164;
private final String email;
private final GroupId groupId;
private final DistributionListId distributionListId;
private final List<Recipient> participants;
private final Optional<Long> groupAvatarId;
private final boolean isSelf;
private final boolean blocked;
private final long muteUntil;
private final VibrateState messageVibrate;
private final VibrateState callVibrate;
private final Uri messageRingtone;
private final Uri callRingtone;
private final Optional<Integer> defaultSubscriptionId;
private final int expireMessages;
private final RegisteredState registered;
private final byte[] profileKey;
private final ProfileKeyCredential profileKeyCredential;
private final String groupName;
private final Uri systemContactPhoto;
private final String customLabel;
private final Uri contactUri;
private final ProfileName signalProfileName;
private final String profileAvatar;
private final boolean hasProfileImage;
private final boolean profileSharing;
private final long lastProfileFetch;
private final String notificationChannel;
private final UnidentifiedAccessMode unidentifiedAccessMode;
private final boolean forceSmsSelection;
private final Capability groupsV1MigrationCapability;
private final Capability senderKeyCapability;
private final Capability announcementGroupCapability;
private final Capability changeNumberCapability;
private final Capability storiesCapability;
private final Capability giftBadgesCapability;
private final InsightsBannerTier insightsBannerTier;
private final byte[] storageId;
private final MentionSetting mentionSetting;
private final ChatWallpaper wallpaper;
private final ChatColors chatColors;
private final AvatarColor avatarColor;
private final String about;
private final String aboutEmoji;
private final ProfileName systemProfileName;
private final String systemContactName;
private final Optional<Extras> extras;
private final boolean hasGroupsInCommon;
private final List<Badge> badges;
private final boolean isReleaseNotesRecipient;
private final RecipientId id;
private final boolean resolving;
private final ServiceId serviceId;
private final PNI pni;
private final String username;
private final String e164;
private final String email;
private final GroupId groupId;
private final DistributionListId distributionListId;
private final List<Recipient> participants;
private final Optional<Long> groupAvatarId;
private final boolean isSelf;
private final boolean blocked;
private final long muteUntil;
private final VibrateState messageVibrate;
private final VibrateState callVibrate;
private final Uri messageRingtone;
private final Uri callRingtone;
private final Optional<Integer> defaultSubscriptionId;
private final int expireMessages;
private final RegisteredState registered;
private final byte[] profileKey;
private final ExpiringProfileKeyCredential expiringProfileKeyCredential;
private final String groupName;
private final Uri systemContactPhoto;
private final String customLabel;
private final Uri contactUri;
private final ProfileName signalProfileName;
private final String profileAvatar;
private final boolean hasProfileImage;
private final boolean profileSharing;
private final long lastProfileFetch;
private final String notificationChannel;
private final UnidentifiedAccessMode unidentifiedAccessMode;
private final boolean forceSmsSelection;
private final Capability groupsV1MigrationCapability;
private final Capability senderKeyCapability;
private final Capability announcementGroupCapability;
private final Capability changeNumberCapability;
private final Capability storiesCapability;
private final Capability giftBadgesCapability;
private final InsightsBannerTier insightsBannerTier;
private final byte[] storageId;
private final MentionSetting mentionSetting;
private final ChatWallpaper wallpaper;
private final ChatColors chatColors;
private final AvatarColor avatarColor;
private final String about;
private final String aboutEmoji;
private final ProfileName systemProfileName;
private final String systemContactName;
private final Optional<Extras> extras;
private final boolean hasGroupsInCommon;
private final List<Badge> badges;
private final boolean isReleaseNotesRecipient;
/**
* Returns a {@link LiveRecipient}, which contains a {@link Recipient} that may or may not be
@@ -358,119 +358,119 @@ public class Recipient {
}
Recipient(@NonNull RecipientId id) {
this.id = id;
this.resolving = true;
this.serviceId = null;
this.pni = null;
this.username = null;
this.e164 = null;
this.email = null;
this.groupId = null;
this.distributionListId = null;
this.participants = Collections.emptyList();
this.groupAvatarId = Optional.empty();
this.isSelf = false;
this.blocked = false;
this.muteUntil = 0;
this.messageVibrate = VibrateState.DEFAULT;
this.callVibrate = VibrateState.DEFAULT;
this.messageRingtone = null;
this.callRingtone = null;
this.insightsBannerTier = InsightsBannerTier.TIER_TWO;
this.defaultSubscriptionId = Optional.empty();
this.expireMessages = 0;
this.registered = RegisteredState.UNKNOWN;
this.profileKey = null;
this.profileKeyCredential = null;
this.groupName = null;
this.systemContactPhoto = null;
this.customLabel = null;
this.contactUri = null;
this.signalProfileName = ProfileName.EMPTY;
this.profileAvatar = null;
this.hasProfileImage = false;
this.profileSharing = false;
this.lastProfileFetch = 0;
this.notificationChannel = null;
this.unidentifiedAccessMode = UnidentifiedAccessMode.DISABLED;
this.forceSmsSelection = false;
this.groupsV1MigrationCapability = Capability.UNKNOWN;
this.senderKeyCapability = Capability.UNKNOWN;
this.announcementGroupCapability = Capability.UNKNOWN;
this.changeNumberCapability = Capability.UNKNOWN;
this.storiesCapability = Capability.UNKNOWN;
this.giftBadgesCapability = Capability.UNKNOWN;
this.storageId = null;
this.mentionSetting = MentionSetting.ALWAYS_NOTIFY;
this.wallpaper = null;
this.chatColors = null;
this.avatarColor = AvatarColor.UNKNOWN;
this.about = null;
this.aboutEmoji = null;
this.systemProfileName = ProfileName.EMPTY;
this.systemContactName = null;
this.extras = Optional.empty();
this.hasGroupsInCommon = false;
this.badges = Collections.emptyList();
this.isReleaseNotesRecipient = false;
this.id = id;
this.resolving = true;
this.serviceId = null;
this.pni = null;
this.username = null;
this.e164 = null;
this.email = null;
this.groupId = null;
this.distributionListId = null;
this.participants = Collections.emptyList();
this.groupAvatarId = Optional.empty();
this.isSelf = false;
this.blocked = false;
this.muteUntil = 0;
this.messageVibrate = VibrateState.DEFAULT;
this.callVibrate = VibrateState.DEFAULT;
this.messageRingtone = null;
this.callRingtone = null;
this.insightsBannerTier = InsightsBannerTier.TIER_TWO;
this.defaultSubscriptionId = Optional.empty();
this.expireMessages = 0;
this.registered = RegisteredState.UNKNOWN;
this.profileKey = null;
this.expiringProfileKeyCredential = null;
this.groupName = null;
this.systemContactPhoto = null;
this.customLabel = null;
this.contactUri = null;
this.signalProfileName = ProfileName.EMPTY;
this.profileAvatar = null;
this.hasProfileImage = false;
this.profileSharing = false;
this.lastProfileFetch = 0;
this.notificationChannel = null;
this.unidentifiedAccessMode = UnidentifiedAccessMode.DISABLED;
this.forceSmsSelection = false;
this.groupsV1MigrationCapability = Capability.UNKNOWN;
this.senderKeyCapability = Capability.UNKNOWN;
this.announcementGroupCapability = Capability.UNKNOWN;
this.changeNumberCapability = Capability.UNKNOWN;
this.storiesCapability = Capability.UNKNOWN;
this.giftBadgesCapability = Capability.UNKNOWN;
this.storageId = null;
this.mentionSetting = MentionSetting.ALWAYS_NOTIFY;
this.wallpaper = null;
this.chatColors = null;
this.avatarColor = AvatarColor.UNKNOWN;
this.about = null;
this.aboutEmoji = null;
this.systemProfileName = ProfileName.EMPTY;
this.systemContactName = null;
this.extras = Optional.empty();
this.hasGroupsInCommon = false;
this.badges = Collections.emptyList();
this.isReleaseNotesRecipient = false;
}
public Recipient(@NonNull RecipientId id, @NonNull RecipientDetails details, boolean resolved) {
this.id = id;
this.resolving = !resolved;
this.serviceId = details.serviceId;
this.pni = details.pni;
this.username = details.username;
this.e164 = details.e164;
this.email = details.email;
this.groupId = details.groupId;
this.distributionListId = details.distributionListId;
this.participants = details.participants;
this.groupAvatarId = details.groupAvatarId;
this.isSelf = details.isSelf;
this.blocked = details.blocked;
this.muteUntil = details.mutedUntil;
this.messageVibrate = details.messageVibrateState;
this.callVibrate = details.callVibrateState;
this.messageRingtone = details.messageRingtone;
this.callRingtone = details.callRingtone;
this.insightsBannerTier = details.insightsBannerTier;
this.defaultSubscriptionId = details.defaultSubscriptionId;
this.expireMessages = details.expireMessages;
this.registered = details.registered;
this.profileKey = details.profileKey;
this.profileKeyCredential = details.profileKeyCredential;
this.groupName = details.groupName;
this.systemContactPhoto = details.systemContactPhoto;
this.customLabel = details.customLabel;
this.contactUri = details.contactUri;
this.signalProfileName = details.profileName;
this.profileAvatar = details.profileAvatar;
this.hasProfileImage = details.hasProfileImage;
this.profileSharing = details.profileSharing;
this.lastProfileFetch = details.lastProfileFetch;
this.notificationChannel = details.notificationChannel;
this.unidentifiedAccessMode = details.unidentifiedAccessMode;
this.forceSmsSelection = details.forceSmsSelection;
this.groupsV1MigrationCapability = details.groupsV1MigrationCapability;
this.senderKeyCapability = details.senderKeyCapability;
this.announcementGroupCapability = details.announcementGroupCapability;
this.changeNumberCapability = details.changeNumberCapability;
this.storiesCapability = details.storiesCapability;
this.giftBadgesCapability = details.giftBadgesCapability;
this.storageId = details.storageId;
this.mentionSetting = details.mentionSetting;
this.wallpaper = details.wallpaper;
this.chatColors = details.chatColors;
this.avatarColor = details.avatarColor;
this.about = details.about;
this.aboutEmoji = details.aboutEmoji;
this.systemProfileName = details.systemProfileName;
this.systemContactName = details.systemContactName;
this.extras = details.extras;
this.hasGroupsInCommon = details.hasGroupsInCommon;
this.badges = details.badges;
this.isReleaseNotesRecipient = details.isReleaseChannel;
this.id = id;
this.resolving = !resolved;
this.serviceId = details.serviceId;
this.pni = details.pni;
this.username = details.username;
this.e164 = details.e164;
this.email = details.email;
this.groupId = details.groupId;
this.distributionListId = details.distributionListId;
this.participants = details.participants;
this.groupAvatarId = details.groupAvatarId;
this.isSelf = details.isSelf;
this.blocked = details.blocked;
this.muteUntil = details.mutedUntil;
this.messageVibrate = details.messageVibrateState;
this.callVibrate = details.callVibrateState;
this.messageRingtone = details.messageRingtone;
this.callRingtone = details.callRingtone;
this.insightsBannerTier = details.insightsBannerTier;
this.defaultSubscriptionId = details.defaultSubscriptionId;
this.expireMessages = details.expireMessages;
this.registered = details.registered;
this.profileKey = details.profileKey;
this.expiringProfileKeyCredential = details.expiringProfileKeyCredential;
this.groupName = details.groupName;
this.systemContactPhoto = details.systemContactPhoto;
this.customLabel = details.customLabel;
this.contactUri = details.contactUri;
this.signalProfileName = details.profileName;
this.profileAvatar = details.profileAvatar;
this.hasProfileImage = details.hasProfileImage;
this.profileSharing = details.profileSharing;
this.lastProfileFetch = details.lastProfileFetch;
this.notificationChannel = details.notificationChannel;
this.unidentifiedAccessMode = details.unidentifiedAccessMode;
this.forceSmsSelection = details.forceSmsSelection;
this.groupsV1MigrationCapability = details.groupsV1MigrationCapability;
this.senderKeyCapability = details.senderKeyCapability;
this.announcementGroupCapability = details.announcementGroupCapability;
this.changeNumberCapability = details.changeNumberCapability;
this.storiesCapability = details.storiesCapability;
this.giftBadgesCapability = details.giftBadgesCapability;
this.storageId = details.storageId;
this.mentionSetting = details.mentionSetting;
this.wallpaper = details.wallpaper;
this.chatColors = details.chatColors;
this.avatarColor = details.avatarColor;
this.about = details.about;
this.aboutEmoji = details.aboutEmoji;
this.systemProfileName = details.systemProfileName;
this.systemContactName = details.systemContactName;
this.extras = details.extras;
this.hasGroupsInCommon = details.hasGroupsInCommon;
this.badges = details.badges;
this.isReleaseNotesRecipient = details.isReleaseChannel;
}
public @NonNull RecipientId getId() {
@@ -1022,12 +1022,8 @@ public class Recipient {
return profileKey;
}
public @Nullable ProfileKeyCredential getProfileKeyCredential() {
return profileKeyCredential;
}
public boolean hasProfileKeyCredential() {
return profileKeyCredential != null;
public @Nullable ExpiringProfileKeyCredential getExpiringProfileKeyCredential() {
return expiringProfileKeyCredential;
}
public @Nullable byte[] getStorageServiceId() {
@@ -1285,7 +1281,7 @@ public class Recipient {
Objects.equals(defaultSubscriptionId, other.defaultSubscriptionId) &&
registered == other.registered &&
Arrays.equals(profileKey, other.profileKey) &&
Objects.equals(profileKeyCredential, other.profileKeyCredential) &&
Objects.equals(expiringProfileKeyCredential, other.expiringProfileKeyCredential) &&
Objects.equals(groupName, other.groupName) &&
Objects.equals(systemContactPhoto, other.systemContactPhoto) &&
Objects.equals(customLabel, other.customLabel) &&

View File

@@ -6,7 +6,7 @@ import android.net.Uri;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import org.signal.libsignal.zkgroup.profiles.ProfileKeyCredential;
import org.signal.libsignal.zkgroup.profiles.ExpiringProfileKeyCredential;
import org.thoughtcrime.securesms.badges.models.Badge;
import org.thoughtcrime.securesms.conversation.colors.AvatarColor;
import org.thoughtcrime.securesms.conversation.colors.ChatColors;
@@ -33,60 +33,60 @@ import java.util.Optional;
public class RecipientDetails {
final ServiceId serviceId;
final PNI pni;
final String username;
final String e164;
final String email;
final GroupId groupId;
final DistributionListId distributionListId;
final String groupName;
final String systemContactName;
final String customLabel;
final Uri systemContactPhoto;
final Uri contactUri;
final Optional<Long> groupAvatarId;
final Uri messageRingtone;
final Uri callRingtone;
final long mutedUntil;
final VibrateState messageVibrateState;
final VibrateState callVibrateState;
final boolean blocked;
final int expireMessages;
final List<Recipient> participants;
final ProfileName profileName;
final Optional<Integer> defaultSubscriptionId;
final RegisteredState registered;
final byte[] profileKey;
final ProfileKeyCredential profileKeyCredential;
final String profileAvatar;
final boolean hasProfileImage;
final boolean profileSharing;
final long lastProfileFetch;
final boolean systemContact;
final boolean isSelf;
final String notificationChannel;
final UnidentifiedAccessMode unidentifiedAccessMode;
final boolean forceSmsSelection;
final Recipient.Capability groupsV1MigrationCapability;
final Recipient.Capability senderKeyCapability;
final Recipient.Capability announcementGroupCapability;
final Recipient.Capability changeNumberCapability;
final Recipient.Capability storiesCapability;
final Recipient.Capability giftBadgesCapability;
final InsightsBannerTier insightsBannerTier;
final byte[] storageId;
final MentionSetting mentionSetting;
final ChatWallpaper wallpaper;
final ChatColors chatColors;
final AvatarColor avatarColor;
final String about;
final String aboutEmoji;
final ProfileName systemProfileName;
final Optional<Recipient.Extras> extras;
final boolean hasGroupsInCommon;
final List<Badge> badges;
final boolean isReleaseChannel;
final ServiceId serviceId;
final PNI pni;
final String username;
final String e164;
final String email;
final GroupId groupId;
final DistributionListId distributionListId;
final String groupName;
final String systemContactName;
final String customLabel;
final Uri systemContactPhoto;
final Uri contactUri;
final Optional<Long> groupAvatarId;
final Uri messageRingtone;
final Uri callRingtone;
final long mutedUntil;
final VibrateState messageVibrateState;
final VibrateState callVibrateState;
final boolean blocked;
final int expireMessages;
final List<Recipient> participants;
final ProfileName profileName;
final Optional<Integer> defaultSubscriptionId;
final RegisteredState registered;
final byte[] profileKey;
final ExpiringProfileKeyCredential expiringProfileKeyCredential;
final String profileAvatar;
final boolean hasProfileImage;
final boolean profileSharing;
final long lastProfileFetch;
final boolean systemContact;
final boolean isSelf;
final String notificationChannel;
final UnidentifiedAccessMode unidentifiedAccessMode;
final boolean forceSmsSelection;
final Recipient.Capability groupsV1MigrationCapability;
final Recipient.Capability senderKeyCapability;
final Recipient.Capability announcementGroupCapability;
final Recipient.Capability changeNumberCapability;
final Recipient.Capability storiesCapability;
final Recipient.Capability giftBadgesCapability;
final InsightsBannerTier insightsBannerTier;
final byte[] storageId;
final MentionSetting mentionSetting;
final ChatWallpaper wallpaper;
final ChatColors chatColors;
final AvatarColor avatarColor;
final String about;
final String aboutEmoji;
final ProfileName systemProfileName;
final Optional<Recipient.Extras> extras;
final boolean hasGroupsInCommon;
final List<Badge> badges;
final boolean isReleaseChannel;
public RecipientDetails(@Nullable String groupName,
@Nullable String systemContactName,
@@ -98,117 +98,117 @@ public class RecipientDetails {
@Nullable List<Recipient> participants,
boolean isReleaseChannel)
{
this.groupAvatarId = groupAvatarId;
this.systemContactPhoto = Util.uri(record.getSystemContactPhotoUri());
this.customLabel = record.getSystemPhoneLabel();
this.contactUri = Util.uri(record.getSystemContactUri());
this.serviceId = record.getServiceId();
this.pni = record.getPni();
this.username = record.getUsername();
this.e164 = record.getE164();
this.email = record.getEmail();
this.groupId = record.getGroupId();
this.distributionListId = record.getDistributionListId();
this.messageRingtone = record.getMessageRingtone();
this.callRingtone = record.getCallRingtone();
this.mutedUntil = record.getMuteUntil();
this.messageVibrateState = record.getMessageVibrateState();
this.callVibrateState = record.getCallVibrateState();
this.blocked = record.isBlocked();
this.expireMessages = record.getExpireMessages();
this.participants = participants == null ? new LinkedList<>() : participants;
this.profileName = record.getProfileName();
this.defaultSubscriptionId = record.getDefaultSubscriptionId();
this.registered = registeredState;
this.profileKey = record.getProfileKey();
this.profileKeyCredential = record.getProfileKeyCredential();
this.profileAvatar = record.getProfileAvatar();
this.hasProfileImage = record.hasProfileImage();
this.profileSharing = record.isProfileSharing();
this.lastProfileFetch = record.getLastProfileFetch();
this.systemContact = systemContact;
this.isSelf = isSelf;
this.notificationChannel = record.getNotificationChannel();
this.unidentifiedAccessMode = record.getUnidentifiedAccessMode();
this.forceSmsSelection = record.isForceSmsSelection();
this.groupsV1MigrationCapability = record.getGroupsV1MigrationCapability();
this.senderKeyCapability = record.getSenderKeyCapability();
this.announcementGroupCapability = record.getAnnouncementGroupCapability();
this.changeNumberCapability = record.getChangeNumberCapability();
this.storiesCapability = record.getStoriesCapability();
this.giftBadgesCapability = record.getGiftBadgesCapability();
this.insightsBannerTier = record.getInsightsBannerTier();
this.storageId = record.getStorageId();
this.mentionSetting = record.getMentionSetting();
this.wallpaper = record.getWallpaper();
this.chatColors = record.getChatColors();
this.avatarColor = record.getAvatarColor();
this.about = record.getAbout();
this.aboutEmoji = record.getAboutEmoji();
this.systemProfileName = record.getSystemProfileName();
this.groupName = groupName;
this.systemContactName = systemContactName;
this.extras = Optional.ofNullable(record.getExtras());
this.hasGroupsInCommon = record.hasGroupsInCommon();
this.badges = record.getBadges();
this.isReleaseChannel = isReleaseChannel;
this.groupAvatarId = groupAvatarId;
this.systemContactPhoto = Util.uri(record.getSystemContactPhotoUri());
this.customLabel = record.getSystemPhoneLabel();
this.contactUri = Util.uri(record.getSystemContactUri());
this.serviceId = record.getServiceId();
this.pni = record.getPni();
this.username = record.getUsername();
this.e164 = record.getE164();
this.email = record.getEmail();
this.groupId = record.getGroupId();
this.distributionListId = record.getDistributionListId();
this.messageRingtone = record.getMessageRingtone();
this.callRingtone = record.getCallRingtone();
this.mutedUntil = record.getMuteUntil();
this.messageVibrateState = record.getMessageVibrateState();
this.callVibrateState = record.getCallVibrateState();
this.blocked = record.isBlocked();
this.expireMessages = record.getExpireMessages();
this.participants = participants == null ? new LinkedList<>() : participants;
this.profileName = record.getProfileName();
this.defaultSubscriptionId = record.getDefaultSubscriptionId();
this.registered = registeredState;
this.profileKey = record.getProfileKey();
this.expiringProfileKeyCredential = record.getExpiringProfileKeyCredential();
this.profileAvatar = record.getProfileAvatar();
this.hasProfileImage = record.hasProfileImage();
this.profileSharing = record.isProfileSharing();
this.lastProfileFetch = record.getLastProfileFetch();
this.systemContact = systemContact;
this.isSelf = isSelf;
this.notificationChannel = record.getNotificationChannel();
this.unidentifiedAccessMode = record.getUnidentifiedAccessMode();
this.forceSmsSelection = record.isForceSmsSelection();
this.groupsV1MigrationCapability = record.getGroupsV1MigrationCapability();
this.senderKeyCapability = record.getSenderKeyCapability();
this.announcementGroupCapability = record.getAnnouncementGroupCapability();
this.changeNumberCapability = record.getChangeNumberCapability();
this.storiesCapability = record.getStoriesCapability();
this.giftBadgesCapability = record.getGiftBadgesCapability();
this.insightsBannerTier = record.getInsightsBannerTier();
this.storageId = record.getStorageId();
this.mentionSetting = record.getMentionSetting();
this.wallpaper = record.getWallpaper();
this.chatColors = record.getChatColors();
this.avatarColor = record.getAvatarColor();
this.about = record.getAbout();
this.aboutEmoji = record.getAboutEmoji();
this.systemProfileName = record.getSystemProfileName();
this.groupName = groupName;
this.systemContactName = systemContactName;
this.extras = Optional.ofNullable(record.getExtras());
this.hasGroupsInCommon = record.hasGroupsInCommon();
this.badges = record.getBadges();
this.isReleaseChannel = isReleaseChannel;
}
private RecipientDetails() {
this.groupAvatarId = null;
this.systemContactPhoto = null;
this.customLabel = null;
this.contactUri = null;
this.serviceId = null;
this.pni = null;
this.username = null;
this.e164 = null;
this.email = null;
this.groupId = null;
this.distributionListId = null;
this.messageRingtone = null;
this.callRingtone = null;
this.mutedUntil = 0;
this.messageVibrateState = VibrateState.DEFAULT;
this.callVibrateState = VibrateState.DEFAULT;
this.blocked = false;
this.expireMessages = 0;
this.participants = new LinkedList<>();
this.profileName = ProfileName.EMPTY;
this.insightsBannerTier = InsightsBannerTier.TIER_TWO;
this.defaultSubscriptionId = Optional.empty();
this.registered = RegisteredState.UNKNOWN;
this.profileKey = null;
this.profileKeyCredential = null;
this.profileAvatar = null;
this.hasProfileImage = false;
this.profileSharing = false;
this.lastProfileFetch = 0;
this.systemContact = true;
this.isSelf = false;
this.notificationChannel = null;
this.unidentifiedAccessMode = UnidentifiedAccessMode.UNKNOWN;
this.forceSmsSelection = false;
this.groupName = null;
this.groupsV1MigrationCapability = Recipient.Capability.UNKNOWN;
this.senderKeyCapability = Recipient.Capability.UNKNOWN;
this.announcementGroupCapability = Recipient.Capability.UNKNOWN;
this.changeNumberCapability = Recipient.Capability.UNKNOWN;
this.storiesCapability = Recipient.Capability.UNKNOWN;
this.giftBadgesCapability = Recipient.Capability.UNKNOWN;
this.storageId = null;
this.mentionSetting = MentionSetting.ALWAYS_NOTIFY;
this.wallpaper = null;
this.chatColors = null;
this.avatarColor = AvatarColor.UNKNOWN;
this.about = null;
this.aboutEmoji = null;
this.systemProfileName = ProfileName.EMPTY;
this.systemContactName = null;
this.extras = Optional.empty();
this.hasGroupsInCommon = false;
this.badges = Collections.emptyList();
this.isReleaseChannel = false;
this.groupAvatarId = null;
this.systemContactPhoto = null;
this.customLabel = null;
this.contactUri = null;
this.serviceId = null;
this.pni = null;
this.username = null;
this.e164 = null;
this.email = null;
this.groupId = null;
this.distributionListId = null;
this.messageRingtone = null;
this.callRingtone = null;
this.mutedUntil = 0;
this.messageVibrateState = VibrateState.DEFAULT;
this.callVibrateState = VibrateState.DEFAULT;
this.blocked = false;
this.expireMessages = 0;
this.participants = new LinkedList<>();
this.profileName = ProfileName.EMPTY;
this.insightsBannerTier = InsightsBannerTier.TIER_TWO;
this.defaultSubscriptionId = Optional.empty();
this.registered = RegisteredState.UNKNOWN;
this.profileKey = null;
this.expiringProfileKeyCredential = null;
this.profileAvatar = null;
this.hasProfileImage = false;
this.profileSharing = false;
this.lastProfileFetch = 0;
this.systemContact = true;
this.isSelf = false;
this.notificationChannel = null;
this.unidentifiedAccessMode = UnidentifiedAccessMode.UNKNOWN;
this.forceSmsSelection = false;
this.groupName = null;
this.groupsV1MigrationCapability = Recipient.Capability.UNKNOWN;
this.senderKeyCapability = Recipient.Capability.UNKNOWN;
this.announcementGroupCapability = Recipient.Capability.UNKNOWN;
this.changeNumberCapability = Recipient.Capability.UNKNOWN;
this.storiesCapability = Recipient.Capability.UNKNOWN;
this.giftBadgesCapability = Recipient.Capability.UNKNOWN;
this.storageId = null;
this.mentionSetting = MentionSetting.ALWAYS_NOTIFY;
this.wallpaper = null;
this.chatColors = null;
this.avatarColor = AvatarColor.UNKNOWN;
this.about = null;
this.aboutEmoji = null;
this.systemProfileName = ProfileName.EMPTY;
this.systemContactName = null;
this.extras = Optional.empty();
this.hasGroupsInCommon = false;
this.badges = Collections.emptyList();
this.isReleaseChannel = false;
}
public static @NonNull RecipientDetails forIndividual(@NonNull Context context, @NonNull RecipientRecord settings) {