mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 18:00:02 +01:00
Group call server selection for internal users.
This commit is contained in:
@@ -2,8 +2,10 @@ package org.thoughtcrime.securesms.keyvalue;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.thoughtcrime.securesms.BuildConfig;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -19,6 +21,7 @@ public final class InternalValues extends SignalStoreValues {
|
||||
public static final String FORCE_CENSORSHIP = "internal.force_censorship";
|
||||
public static final String FORCE_BUILT_IN_EMOJI = "internal.force_built_in_emoji";
|
||||
public static final String REMOVE_SENDER_KEY_MINIMUM = "internal.remove_sender_key_minimum";
|
||||
public static final String CALLING_SERVER = "internal.calling_server";
|
||||
|
||||
InternalValues(KeyValueStore store) {
|
||||
super(store);
|
||||
@@ -111,4 +114,19 @@ public final class InternalValues extends SignalStoreValues {
|
||||
public synchronized boolean disableGv1AutoMigrateNotification() {
|
||||
return FeatureFlags.internalUser() && getBoolean(GV2_DISABLE_AUTOMIGRATE_NOTIFICATION, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* The selected group calling server to use.
|
||||
* <p>
|
||||
* The user must be an internal user and the setting must be one of the current set of internal servers otherwise
|
||||
* the default SFU will be returned. This ensures that if the {@link BuildConfig#SIGNAL_SFU_INTERNAL_URLS} list changes,
|
||||
* internal users cannot be left on old servers.
|
||||
*/
|
||||
public synchronized @NonNull String groupCallingServer() {
|
||||
String internalServer = FeatureFlags.internalUser() ? getString(CALLING_SERVER, null) : null;
|
||||
if (internalServer != null && !Arrays.asList(BuildConfig.SIGNAL_SFU_INTERNAL_URLS).contains(internalServer)) {
|
||||
internalServer = null;
|
||||
}
|
||||
return internalServer != null ? internalServer : BuildConfig.SIGNAL_SFU_URL;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user