diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/RecipientTable.kt b/app/src/main/java/org/thoughtcrime/securesms/database/RecipientTable.kt index 099267495e..f6bda3112d 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/RecipientTable.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/database/RecipientTable.kt @@ -793,11 +793,7 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da val recipientId: RecipientId if (id < 0) { Log.w(TAG, "[applyStorageSyncContactInsert] Failed to insert. Possibly merging.") - if (FeatureFlags.phoneNumberPrivacy()) { - recipientId = getAndPossiblyMergePnpVerified(insert.aci.orNull(), insert.pni.orNull(), insert.number.orNull()) - } else { - recipientId = getAndPossiblyMerge(insert.aci.orNull(), insert.number.orNull()) - } + recipientId = getAndPossiblyMergePnpVerified(insert.aci.orNull(), insert.pni.orNull(), insert.number.orNull()) db.update(TABLE_NAME, values, ID_WHERE, SqlUtil.buildArgs(recipientId)) } else { recipientId = RecipientId.from(id) @@ -834,11 +830,7 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da var recipientId = getByColumn(STORAGE_SERVICE_ID, Base64.encodeBytes(update.old.id.raw)).get() Log.w(TAG, "[applyStorageSyncContactUpdate] Found user $recipientId. Possibly merging.") - if (FeatureFlags.phoneNumberPrivacy()) { - recipientId = getAndPossiblyMergePnpVerified(update.new.aci.orElse(null), update.new.pni.orElse(null), update.new.number.orElse(null)) - } else { - recipientId = getAndPossiblyMerge(update.new.aci.orElse(null), update.new.number.orElse(null)) - } + recipientId = getAndPossiblyMergePnpVerified(update.new.aci.orElse(null), update.new.pni.orElse(null), update.new.number.orElse(null)) Log.w(TAG, "[applyStorageSyncContactUpdate] Merged into $recipientId") db.update(TABLE_NAME, values, ID_WHERE, SqlUtil.buildArgs(recipientId)) @@ -2158,14 +2150,10 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da } fun markUnregistered(id: RecipientId) { - if (FeatureFlags.phoneNumberPrivacy()) { - val record = getRecord(id) + val record = getRecord(id) - if (record.aci != null && record.pni != null) { - markUnregisteredAndSplit(id, record) - } else { - markUnregisteredWithoutSplit(id) - } + if (record.aci != null && record.pni != null) { + markUnregisteredAndSplit(id, record) } else { markUnregisteredWithoutSplit(id) } @@ -2216,8 +2204,6 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da * Done so we can match a split contact during storage sync. */ fun splitForStorageSync(storageId: ByteArray) { - check(FeatureFlags.phoneNumberPrivacy()) - val record = getByStorageId(storageId)!! check(record.aci != null && record.pni != null) @@ -3874,11 +3860,7 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da val username = contact.username.orElse(null) put(ACI_COLUMN, contact.aci.orElse(null)?.toString()) - - if (FeatureFlags.phoneNumberPrivacy()) { - put(PNI_COLUMN, contact.pni.orElse(null)?.toString()) - } - + put(PNI_COLUMN, contact.pni.orElse(null)?.toString()) put(E164, contact.number.orElse(null)) put(PROFILE_GIVEN_NAME, profileName.givenName) put(PROFILE_FAMILY_NAME, profileName.familyName) diff --git a/app/src/main/java/org/thoughtcrime/securesms/jobs/PnpInitializeDevicesJob.kt b/app/src/main/java/org/thoughtcrime/securesms/jobs/PnpInitializeDevicesJob.kt index b2e9a7302c..65b7c4093f 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/jobs/PnpInitializeDevicesJob.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/jobs/PnpInitializeDevicesJob.kt @@ -76,10 +76,6 @@ class PnpInitializeDevicesJob private constructor(parameters: Parameters) : Base throw IllegalStateException("This should only be run if you have the capability!") } - if (!FeatureFlags.phoneNumberPrivacy()) { - throw IllegalStateException("This should only be running if PNP is enabled!") - } - if (!SignalStore.account().isRegistered || SignalStore.account().aci == null) { Log.w(TAG, "Not registered! Skipping, as it wouldn't do anything.") return diff --git a/app/src/main/java/org/thoughtcrime/securesms/storage/AccountRecordProcessor.java b/app/src/main/java/org/thoughtcrime/securesms/storage/AccountRecordProcessor.java index e9cb7047b7..601320ca12 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/storage/AccountRecordProcessor.java +++ b/app/src/main/java/org/thoughtcrime/securesms/storage/AccountRecordProcessor.java @@ -117,7 +117,7 @@ public class AccountRecordProcessor extends DefaultStorageRecordProcessor defaultReactions = remote.getDefaultReactions().size() > 0 ? remote.getDefaultReactions() : local.getDefaultReactions(); boolean displayBadgesOnProfile = remote.isDisplayBadgesOnProfile(); boolean subscriptionManuallyCancelled = remote.isSubscriptionManuallyCancelled(); @@ -169,7 +169,7 @@ public class AccountRecordProcessor extends DefaultStorageRecordProcessor remoteRecords, @NonNull StorageKeyGenerator keyGenerator) throws IOException { - if (!FeatureFlags.phoneNumberPrivacy()) { - super.process(remoteRecords, keyGenerator); - return; - } - List unregisteredAciOnly = new ArrayList<>(); List pniE164Only = new ArrayList<>(); @@ -149,10 +144,6 @@ public class ContactRecordProcessor extends DefaultStorageRecordProcessor getMatching(@NonNull SignalContactRecord remote, @NonNull StorageKeyGenerator keyGenerator) { - if (!FeatureFlags.phoneNumberPrivacy()) { - remote = remote.withoutPni(); - } - Optional found = remote.getAci().isPresent() ? recipientTable.getByAci(remote.getAci().get()) : Optional.empty(); if (found.isEmpty() && remote.getNumber().isPresent()) { @@ -180,11 +171,6 @@ public class ContactRecordProcessor extends DefaultStorageRecordProcessor