mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 10:20:25 +01:00
Add the ability to migrate GV1 groups to GV2.
Co-authored-by: Alan Evans <alan@signal.org>
This commit is contained in:
committed by
Alan Evans
parent
2d1bf33902
commit
6bb9d27d4e
@@ -4,12 +4,14 @@ import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
|
||||
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 RECIPIENT_DETAILS = "internal.recipient_details";
|
||||
public static final String FORCE_CENSORSHIP = "internal.force_censorship";
|
||||
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 FORCE_CENSORSHIP = "internal.force_censorship";
|
||||
|
||||
InternalValues(KeyValueStore store) {
|
||||
super(store);
|
||||
@@ -67,4 +69,20 @@ public final class InternalValues extends SignalStoreValues {
|
||||
public synchronized boolean forcedCensorship() {
|
||||
return FeatureFlags.internalUser() && getBoolean(FORCE_CENSORSHIP, 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
package org.thoughtcrime.securesms.keyvalue;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public final class MiscellaneousValues extends SignalStoreValues {
|
||||
|
||||
private static final String LAST_PREKEY_REFRESH_TIME = "last_prekey_refresh_time";
|
||||
private static final String MESSAGE_REQUEST_ENABLE_TIME = "message_request_enable_time";
|
||||
private static final String LAST_PROFILE_REFRESH_TIME = "misc.last_profile_refresh_time";
|
||||
private static final String USERNAME_SHOW_REMINDER = "username.show.reminder";
|
||||
private static final String CLIENT_DEPRECATED = "misc.client_deprecated";
|
||||
private static final String LAST_PREKEY_REFRESH_TIME = "last_prekey_refresh_time";
|
||||
private static final String MESSAGE_REQUEST_ENABLE_TIME = "message_request_enable_time";
|
||||
private static final String LAST_PROFILE_REFRESH_TIME = "misc.last_profile_refresh_time";
|
||||
private static final String LAST_GV1_ROUTINE_MIGRATION_TIME = "misc.last_gv1_routine_migration_time";
|
||||
private static final String USERNAME_SHOW_REMINDER = "username.show.reminder";
|
||||
private static final String CLIENT_DEPRECATED = "misc.client_deprecated";
|
||||
|
||||
MiscellaneousValues(@NonNull KeyValueStore store) {
|
||||
super(store);
|
||||
@@ -43,6 +40,14 @@ public final class MiscellaneousValues extends SignalStoreValues {
|
||||
putLong(LAST_PROFILE_REFRESH_TIME, time);
|
||||
}
|
||||
|
||||
public long getLastGv1RoutineMigrationTime() {
|
||||
return getLong(LAST_GV1_ROUTINE_MIGRATION_TIME, 0);
|
||||
}
|
||||
|
||||
public void setLastGv1RoutineMigrationTime(long time) {
|
||||
putLong(LAST_GV1_ROUTINE_MIGRATION_TIME, time);
|
||||
}
|
||||
|
||||
public void hideUsernameReminder() {
|
||||
putBoolean(USERNAME_SHOW_REMINDER, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user