Remove some outdated internal settings.

fork-5.53.8
Greyson Parrelli 2022-09-01 13:52:17 -04:00
rodzic 286010ce90
commit e4b2e5022f
9 zmienionych plików z 9 dodań i 107 usunięć

Wyświetl plik

@ -171,15 +171,6 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter
sectionHeaderPref(R.string.preferences__internal_preferences_groups_v2)
switchPref(
title = DSLSettingsText.from(R.string.preferences__internal_do_not_create_gv2),
summary = DSLSettingsText.from(R.string.preferences__internal_do_not_create_gv2_description),
isChecked = state.gv2doNotCreateGv2Groups,
onClick = {
viewModel.setGv2DoNotCreateGv2Groups(!state.gv2doNotCreateGv2Groups)
}
)
switchPref(
title = DSLSettingsText.from(R.string.preferences__internal_force_gv2_invites),
summary = DSLSettingsText.from(R.string.preferences__internal_force_gv2_invites_description),
@ -209,28 +200,6 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter
dividerPref()
sectionHeaderPref(R.string.preferences__internal_preferences_groups_v1_migration)
switchPref(
title = DSLSettingsText.from(R.string.preferences__internal_do_not_initiate_automigrate),
summary = DSLSettingsText.from(R.string.preferences__internal_do_not_initiate_automigrate_description),
isChecked = state.disableAutoMigrationInitiation,
onClick = {
viewModel.setDisableAutoMigrationInitiation(!state.disableAutoMigrationInitiation)
}
)
switchPref(
title = DSLSettingsText.from(R.string.preferences__internal_do_not_notify_automigrate),
summary = DSLSettingsText.from(R.string.preferences__internal_do_not_notify_automigrate_description),
isChecked = state.disableAutoMigrationNotification,
onClick = {
viewModel.setDisableAutoMigrationNotification(!state.disableAutoMigrationNotification)
}
)
dividerPref()
sectionHeaderPref(R.string.preferences__internal_network)
switchPref(

Wyświetl plik

@ -6,12 +6,9 @@ import org.thoughtcrime.securesms.emoji.EmojiFiles
data class InternalSettingsState(
val seeMoreUserDetails: Boolean,
val shakeToReport: Boolean,
val gv2doNotCreateGv2Groups: Boolean,
val gv2forceInvites: Boolean,
val gv2ignoreServerChanges: Boolean,
val gv2ignoreP2PChanges: Boolean,
val disableAutoMigrationInitiation: Boolean,
val disableAutoMigrationNotification: Boolean,
val allowCensorshipSetting: Boolean,
val callingServer: String,
val callingAudioProcessingMethod: CallManager.AudioProcessingMethod,

Wyświetl plik

@ -38,11 +38,6 @@ class InternalSettingsViewModel(private val repository: InternalSettingsReposito
refresh()
}
fun setGv2DoNotCreateGv2Groups(enabled: Boolean) {
preferenceDataStore.putBoolean(InternalValues.GV2_DO_NOT_CREATE_GV2, enabled)
refresh()
}
fun setGv2ForceInvites(enabled: Boolean) {
preferenceDataStore.putBoolean(InternalValues.GV2_FORCE_INVITES, enabled)
refresh()
@ -58,16 +53,6 @@ class InternalSettingsViewModel(private val repository: InternalSettingsReposito
refresh()
}
fun setDisableAutoMigrationInitiation(enabled: Boolean) {
preferenceDataStore.putBoolean(InternalValues.GV2_DISABLE_AUTOMIGRATE_INITIATION, enabled)
refresh()
}
fun setDisableAutoMigrationNotification(enabled: Boolean) {
preferenceDataStore.putBoolean(InternalValues.GV2_DISABLE_AUTOMIGRATE_NOTIFICATION, enabled)
refresh()
}
fun setAllowCensorshipSetting(enabled: Boolean) {
preferenceDataStore.putBoolean(InternalValues.ALLOW_CENSORSHIP_SETTING, enabled)
refresh()
@ -125,12 +110,9 @@ class InternalSettingsViewModel(private val repository: InternalSettingsReposito
private fun getState() = InternalSettingsState(
seeMoreUserDetails = SignalStore.internalValues().recipientDetails(),
shakeToReport = SignalStore.internalValues().shakeToReport(),
gv2doNotCreateGv2Groups = SignalStore.internalValues().gv2DoNotCreateGv2Groups(),
gv2forceInvites = SignalStore.internalValues().gv2ForceInvites(),
gv2ignoreServerChanges = SignalStore.internalValues().gv2IgnoreServerChanges(),
gv2ignoreP2PChanges = SignalStore.internalValues().gv2IgnoreP2PChanges(),
disableAutoMigrationInitiation = SignalStore.internalValues().disableGv1AutoMigrateInitiation(),
disableAutoMigrationNotification = SignalStore.internalValues().disableGv1AutoMigrateNotification(),
allowCensorshipSetting = SignalStore.internalValues().allowChangingCensorshipSetting(),
callingServer = SignalStore.internalValues().groupCallingServer(),
callingAudioProcessingMethod = SignalStore.internalValues().callingAudioProcessingMethod(),

Wyświetl plik

@ -3717,7 +3717,8 @@ open class RecipientDatabase(context: Context, databaseHelper: SignalDatabase) :
}
/**
* Should only be used for debugging! A very destructive action that clears all known serviceIds.
* Should only be used for debugging! A very destructive action that clears all known serviceIds from people with phone numbers (so that we could eventually
* get them back through CDS).
*/
fun debugClearServiceIds(recipientId: RecipientId? = null) {
writableDatabase
@ -3728,9 +3729,9 @@ open class RecipientDatabase(context: Context, databaseHelper: SignalDatabase) :
)
.run {
if (recipientId == null) {
where("$ID != ?", Recipient.self().id)
where("$ID != ? AND $PHONE NOT NULL", Recipient.self().id)
} else {
where("$ID = ?", recipientId)
where("$ID = ? AND $PHONE NOT NULL", recipientId)
}
}
.run()

Wyświetl plik

@ -47,7 +47,7 @@ public final class GroupManager {
int disappearingMessagesTimer)
throws GroupChangeBusyException, GroupChangeFailedException, IOException
{
boolean shouldAttemptToCreateV2 = !mms && !SignalStore.internalValues().gv2DoNotCreateGv2Groups();
boolean shouldAttemptToCreateV2 = !mms;
Set<RecipientId> memberIds = getMemberIds(members);
if (shouldAttemptToCreateV2) {

Wyświetl plik

@ -81,11 +81,6 @@ public final class GroupsV1MigrationUtil {
throw new InvalidMigrationStateException();
}
if (!forced && SignalStore.internalValues().disableGv1AutoMigrateInitiation()) {
Log.w(TAG, "Auto migration initiation has been disabled! Skipping.");
throw new InvalidMigrationStateException();
}
List<Recipient> registeredMembers = RecipientUtil.getEligibleForSending(Recipient.resolvedList(groupRecipient.getParticipantIds()));
if (RecipientUtil.ensureUuidsAreAvailable(context, registeredMembers)) {
@ -136,7 +131,7 @@ public final class GroupsV1MigrationUtil {
DecryptedGroup decryptedGroup = performLocalMigration(context, gv1Id, threadId, groupRecipient);
if (newlyCreated && decryptedGroup != null && !SignalStore.internalValues().disableGv1AutoMigrateNotification()) {
if (newlyCreated && decryptedGroup != null) {
Log.i(TAG, "Sending no-op update to notify others.");
GroupManager.sendNoopUpdate(context, gv2MasterKey, decryptedGroup);
}

Wyświetl plik

@ -50,17 +50,8 @@ public final class AddGroupDetailsViewModel extends ViewModel {
MutableLiveData<List<GroupMemberEntry.NewGroupCandidate>> initialMembers = new MutableLiveData<>();
LiveData<Boolean> isValidName = Transformations.map(name, name -> !TextUtils.isEmpty(name));
members = LiveDataUtil.combineLatest(initialMembers, deleted, AddGroupDetailsViewModel::filterDeletedMembers);
isMms = Transformations.map(members, AddGroupDetailsViewModel::isAnyForcedSms);
LiveData<List<GroupMemberEntry.NewGroupCandidate>> membersToCheckGv2CapabilityOf = LiveDataUtil.combineLatest(isMms, members, (forcedMms, memberList) -> {
if (SignalStore.internalValues().gv2DoNotCreateGv2Groups() || forcedMms) {
return Collections.emptyList();
} else {
return memberList;
}
});
members = LiveDataUtil.combineLatest(initialMembers, deleted, AddGroupDetailsViewModel::filterDeletedMembers);
isMms = Transformations.map(members, AddGroupDetailsViewModel::isAnyForcedSms);
canSubmitForm = LiveDataUtil.combineLatest(isMms, isValidName, (mms, validName) -> mms || validName);
repository.resolveMembers(recipientIds, initialMembers::postValue);

Wyświetl plik

@ -12,12 +12,9 @@ import java.util.List;
public final class InternalValues extends SignalStoreValues {
public static final String GV2_DO_NOT_CREATE_GV2 = "internal.gv2.do_not_create_gv2";
public static final String GV2_FORCE_INVITES = "internal.gv2.force_invites";
public static final String GV2_IGNORE_SERVER_CHANGES = "internal.gv2.ignore_server_changes";
public static final String GV2_IGNORE_P2P_CHANGES = "internal.gv2.ignore_p2p_changes";
public static final String GV2_DISABLE_AUTOMIGRATE_INITIATION = "internal.gv2.disable_automigrate_initiation";
public static final String GV2_DISABLE_AUTOMIGRATE_NOTIFICATION = "internal.gv2.disable_automigrate_notification";
public static final String RECIPIENT_DETAILS = "internal.recipient_details";
public static final String ALLOW_CENSORSHIP_SETTING = "internal.force_censorship";
public static final String FORCE_BUILT_IN_EMOJI = "internal.force_built_in_emoji";
@ -43,13 +40,6 @@ public final class InternalValues extends SignalStoreValues {
return Collections.emptyList();
}
/**
* Do not attempt to create GV2 groups, i.e. will force creation of GV1 or MMS groups.
*/
public synchronized boolean gv2DoNotCreateGv2Groups() {
return FeatureFlags.internalUser() && getBoolean(GV2_DO_NOT_CREATE_GV2, false);
}
/**
* Members will not be added directly to a GV2 even if they could be.
*/
@ -113,22 +103,6 @@ public final class InternalValues extends SignalStoreValues {
return FeatureFlags.internalUser() && getBoolean(DELAY_RESENDS, false);
}
/**
* Disable initiating a GV1->GV2 auto-migration. You can still recognize a group has been
* auto-migrated.
*/
public synchronized boolean disableGv1AutoMigrateInitiation() {
return FeatureFlags.internalUser() && getBoolean(GV2_DISABLE_AUTOMIGRATE_INITIATION, false);
}
/**
* Disable sending a group update after an automigration. This will force other group members to
* have to discover the migration on their own.
*/
public synchronized boolean disableGv1AutoMigrateNotification() {
return FeatureFlags.internalUser() && getBoolean(GV2_DISABLE_AUTOMIGRATE_NOTIFICATION, false);
}
/**
* Whether or not "shake to report" is enabled.
*/

Wyświetl plik

@ -2745,19 +2745,12 @@
<string name="preferences__internal_clears_onboarding_flag_and_triggers_download_of_onboarding_stories" translatable="false">Clears onboarding flag and triggers download of onboarding stories.</string>
<string name="preferences__internal_preferences" translatable="false">Internal Preferences</string>
<string name="preferences__internal_preferences_groups_v2" translatable="false">Groups V2</string>
<string name="preferences__internal_preferences_groups_v1_migration" translatable="false">Groups V1 Migration</string>
<string name="preferences__internal_do_not_create_gv2" translatable="false">Do not create GV2 groups</string>
<string name="preferences__internal_do_not_create_gv2_description" translatable="false">Do not attempt to create GV2 groups, i.e. will force creation of GV1 or MMS groups.</string>
<string name="preferences__internal_force_gv2_invites" translatable="false">Force Invites</string>
<string name="preferences__internal_force_gv2_invites_description" translatable="false">Members will not be added directly to a GV2 even if they could be.</string>
<string name="preferences__internal_ignore_gv2_server_changes" translatable="false">Ignore server changes</string>
<string name="preferences__internal_ignore_gv2_server_changes_description" translatable="false">Changes in server\'s response will be ignored, causing passive voice update messages if P2P is also ignored.</string>
<string name="preferences__internal_ignore_gv2_p2p_changes" translatable="false">Ignore P2P changes</string>
<string name="preferences__internal_ignore_gv2_p2p_changes_description" translatable="false">Changes sent P2P will be ignored. In conjunction with ignoring server changes, will cause passive voice.</string>
<string name="preferences__internal_do_not_initiate_automigrate" translatable="false">Disable Auto-Migration Initiation</string>
<string name="preferences__internal_do_not_initiate_automigrate_description" translatable="false">Do not attempt to initiate an auto-migration. You will still recognize migrated groups.</string>
<string name="preferences__internal_do_not_notify_automigrate" translatable="false">Disable Auto-Migration Notification</string>
<string name="preferences__internal_do_not_notify_automigrate_description" translatable="false">Do not attempt to notify other users of an auto-migration. They will have to discover it on their own.</string>
<string name="preferences__internal_payments" translatable="false">Payments</string>
<string name="preferences__internal_payment_copy_data" translatable="false">Copy payments data</string>
<string name="preferences__internal_payment_copy_data_description" translatable="false">Copy all payment records to clipboard.</string>
@ -2833,7 +2826,7 @@
<string name="preferences__internal_clear_history" translatable="false">Clear history</string>
<string name="preferences__internal_clear_history_description" translatable="false">Clears all CDS history, meaning the next sync will consider all numbers to be new.</string>
<string name="preferences__internal_clear_all_service_ids" translatable="false">Clear all service IDs</string>
<string name="preferences__internal_clear_all_service_ids_description" translatable="false">Clears all known service IDs (except your own). Do not use on your personal device!</string>
<string name="preferences__internal_clear_all_service_ids_description" translatable="false">Clears all known service IDs (except your own) for people that have phone numbers. Do not use on your personal device!</string>
<string name="preferences__internal_clear_all_profile_keys" translatable="false">Clear all profile keys</string>
<string name="preferences__internal_clear_all_profile_keys_description" translatable="false">Clears all known profile keys (except your own). Do not use on your personal device!</string>
<string name="preferences__internal_donor_error_expired_badge" translatable="false">Expired Badge</string>