mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 02:10:44 +01:00
Respect the phoneNumberSharing setting on the profile.
This commit is contained in:
committed by
Clark Chen
parent
624f863da4
commit
bb30535afb
@@ -150,6 +150,17 @@ public final class ProfileUtil {
|
||||
return decryptString(profileKey, Base64.decode(encryptedStringBase64));
|
||||
}
|
||||
|
||||
public static Optional<Boolean> decryptBoolean(@NonNull ProfileKey profileKey, @Nullable String encryptedBooleanBase64)
|
||||
throws InvalidCiphertextException, IOException
|
||||
{
|
||||
if (encryptedBooleanBase64 == null) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
ProfileCipher profileCipher = new ProfileCipher(profileKey);
|
||||
return profileCipher.decryptBoolean(Base64.decode(encryptedBooleanBase64));
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
public static @NonNull MobileCoinPublicAddress getAddressForRecipient(@NonNull Recipient recipient)
|
||||
throws IOException, PaymentsAddressException
|
||||
@@ -347,7 +358,8 @@ public final class ProfileUtil {
|
||||
aboutEmoji,
|
||||
Optional.ofNullable(paymentsAddress),
|
||||
avatar,
|
||||
badgeIds).orElse(null);
|
||||
badgeIds,
|
||||
SignalStore.phoneNumberPrivacy().isPhoneNumberSharingEnabled()).orElse(null);
|
||||
SignalStore.registrationValues().markHasUploadedProfile();
|
||||
if (!avatar.keepTheSame) {
|
||||
SignalDatabase.recipients().setProfileAvatar(Recipient.self().getId(), avatarPath);
|
||||
|
||||
Reference in New Issue
Block a user