kopia lustrzana https://github.com/ryukoposting/Signal-Android
Group call server selection for internal users.
rodzic
1dca3698d2
commit
b3ebf778fd
|
@ -115,6 +115,8 @@ android {
|
|||
buildConfigField "String", "SIGNAL_SERVICE_STATUS_URL", "\"uptime.signal.org\""
|
||||
buildConfigField "String", "SIGNAL_KEY_BACKUP_URL", "\"https://api.backup.signal.org\""
|
||||
buildConfigField "String", "SIGNAL_SFU_URL", "\"https://sfu.voip.signal.org\""
|
||||
buildConfigField "String[]", "SIGNAL_SFU_INTERNAL_NAMES", "new String[]{\"Test\", \"Staging\"}"
|
||||
buildConfigField "String[]", "SIGNAL_SFU_INTERNAL_URLS", "new String[]{\"https://sfu.test.voip.signal.org\", \"https://sfu.staging.voip.signal.org\"}"
|
||||
buildConfigField "String", "CONTENT_PROXY_HOST", "\"contentproxy.signal.org\""
|
||||
buildConfigField "int", "CONTENT_PROXY_PORT", "443"
|
||||
buildConfigField "String", "SIGNAL_AGENT", "\"OWA\""
|
||||
|
|
|
@ -8,6 +8,7 @@ import android.widget.Toast
|
|||
import androidx.lifecycle.ViewModelProviders
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import org.signal.core.util.concurrent.SignalExecutors
|
||||
import org.thoughtcrime.securesms.BuildConfig
|
||||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.components.settings.DSLConfiguration
|
||||
import org.thoughtcrime.securesms.components.settings.DSLSettingsAdapter
|
||||
|
@ -242,6 +243,31 @@ class InternalSettingsFragment : DSLSettingsFragment(R.string.preferences__inter
|
|||
viewModel.setRemoveSenderKeyMinimum(!state.removeSenderKeyMinimium)
|
||||
}
|
||||
)
|
||||
|
||||
dividerPref()
|
||||
|
||||
sectionHeaderPref(R.string.preferences__internal_calling)
|
||||
|
||||
radioPref(
|
||||
title = DSLSettingsText.from(R.string.preferences__internal_calling_default),
|
||||
summary = DSLSettingsText.from(BuildConfig.SIGNAL_SFU_URL),
|
||||
isChecked = state.callingServer == BuildConfig.SIGNAL_SFU_URL,
|
||||
onClick = {
|
||||
viewModel.setInternalGroupCallingServer(null)
|
||||
}
|
||||
)
|
||||
|
||||
BuildConfig.SIGNAL_SFU_INTERNAL_NAMES.zip(BuildConfig.SIGNAL_SFU_INTERNAL_URLS)
|
||||
.forEach { (name, server) ->
|
||||
radioPref(
|
||||
title = DSLSettingsText.from(requireContext().getString(R.string.preferences__internal_calling_s_server, name)),
|
||||
summary = DSLSettingsText.from(server),
|
||||
isChecked = state.callingServer == server,
|
||||
onClick = {
|
||||
viewModel.setInternalGroupCallingServer(server)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ data class InternalSettingsState(
|
|||
val disableAutoMigrationInitiation: Boolean,
|
||||
val disableAutoMigrationNotification: Boolean,
|
||||
val forceCensorship: Boolean,
|
||||
val callingServer: String,
|
||||
val useBuiltInEmojiSet: Boolean,
|
||||
val emojiVersion: EmojiFiles.Version?,
|
||||
val removeSenderKeyMinimium: Boolean,
|
||||
|
|
|
@ -70,6 +70,11 @@ class InternalSettingsViewModel(private val repository: InternalSettingsReposito
|
|||
refresh()
|
||||
}
|
||||
|
||||
fun setInternalGroupCallingServer(server: String?) {
|
||||
preferenceDataStore.putString(InternalValues.CALLING_SERVER, server)
|
||||
refresh()
|
||||
}
|
||||
|
||||
private fun refresh() {
|
||||
store.update { getState().copy(emojiVersion = it.emojiVersion) }
|
||||
}
|
||||
|
@ -83,6 +88,7 @@ class InternalSettingsViewModel(private val repository: InternalSettingsReposito
|
|||
disableAutoMigrationInitiation = SignalStore.internalValues().disableGv1AutoMigrateInitiation(),
|
||||
disableAutoMigrationNotification = SignalStore.internalValues().disableGv1AutoMigrateNotification(),
|
||||
forceCensorship = SignalStore.internalValues().forcedCensorship(),
|
||||
callingServer = SignalStore.internalValues().groupCallingServer(),
|
||||
useBuiltInEmojiSet = SignalStore.internalValues().forceBuiltInEmoji(),
|
||||
emojiVersion = null,
|
||||
removeSenderKeyMinimium = SignalStore.internalValues().removeSenderKeyMinimum()
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ import androidx.annotation.NonNull;
|
|||
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.signal.ringrtc.GroupCall;
|
||||
import org.thoughtcrime.securesms.BuildConfig;
|
||||
import org.thoughtcrime.securesms.events.WebRtcViewModel;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.ringrtc.RemotePeer;
|
||||
|
@ -44,7 +43,7 @@ class GroupNetworkUnavailableActionProcessor extends WebRtcActionProcessor {
|
|||
|
||||
byte[] groupId = currentState.getCallInfoState().getCallRecipient().requireGroupId().getDecodedId();
|
||||
GroupCall groupCall = webRtcInteractor.getCallManager().createGroupCall(groupId,
|
||||
BuildConfig.SIGNAL_SFU_URL,
|
||||
SignalStore.internalValues().groupCallingServer(),
|
||||
currentState.getVideoState().requireEglBase(),
|
||||
webRtcInteractor.getGroupCallObserver());
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ import org.signal.core.util.logging.Log;
|
|||
import org.signal.ringrtc.CallException;
|
||||
import org.signal.ringrtc.GroupCall;
|
||||
import org.signal.ringrtc.PeekInfo;
|
||||
import org.thoughtcrime.securesms.BuildConfig;
|
||||
import org.thoughtcrime.securesms.components.webrtc.BroadcastVideoSink;
|
||||
import org.thoughtcrime.securesms.events.CallParticipant;
|
||||
import org.thoughtcrime.securesms.events.CallParticipantId;
|
||||
|
@ -45,7 +44,7 @@ public class GroupPreJoinActionProcessor extends GroupActionProcessor {
|
|||
|
||||
byte[] groupId = currentState.getCallInfoState().getCallRecipient().requireGroupId().getDecodedId();
|
||||
GroupCall groupCall = webRtcInteractor.getCallManager().createGroupCall(groupId,
|
||||
BuildConfig.SIGNAL_SFU_URL,
|
||||
SignalStore.internalValues().groupCallingServer(),
|
||||
currentState.getVideoState().requireEglBase(),
|
||||
webRtcInteractor.getGroupCallObserver());
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ import org.signal.ringrtc.HttpHeader;
|
|||
import org.signal.ringrtc.Remote;
|
||||
import org.signal.storageservice.protos.groups.GroupExternalCredential;
|
||||
import org.signal.zkgroup.VerificationFailedException;
|
||||
import org.thoughtcrime.securesms.BuildConfig;
|
||||
import org.thoughtcrime.securesms.WebRtcCallActivity;
|
||||
import org.thoughtcrime.securesms.crypto.UnidentifiedAccessUtil;
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||
|
@ -33,6 +32,7 @@ import org.thoughtcrime.securesms.groups.GroupId;
|
|||
import org.thoughtcrime.securesms.groups.GroupManager;
|
||||
import org.thoughtcrime.securesms.jobs.GroupCallUpdateSendJob;
|
||||
import org.thoughtcrime.securesms.jobs.RetrieveProfileJob;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientUtil;
|
||||
|
@ -286,7 +286,7 @@ public final class SignalCallManager implements CallManager.Observer, GroupCall.
|
|||
.map(entry -> new GroupCall.GroupMemberInfo(entry.getKey(), entry.getValue().serialize()))
|
||||
.toList();
|
||||
|
||||
callManager.peekGroupCall(BuildConfig.SIGNAL_SFU_URL, credential.getTokenBytes().toByteArray(), members, peekInfo -> {
|
||||
callManager.peekGroupCall(SignalStore.internalValues().groupCallingServer(), credential.getTokenBytes().toByteArray(), members, peekInfo -> {
|
||||
long threadId = DatabaseFactory.getThreadDatabase(context).getThreadIdFor(group);
|
||||
|
||||
DatabaseFactory.getSmsDatabase(context)
|
||||
|
|
|
@ -2479,6 +2479,9 @@
|
|||
<string name="preferences__internal_click_to_delete_all_sharing_state" translatable="false">Click to delete all sharing state</string>
|
||||
<string name="preferences__internal_remove_two_person_minimum" translatable="false">Remove 2 person minimum</string>
|
||||
<string name="preferences__internal_remove_the_requirement_that_you_need" translatable="false">Remove the requirement that you need at least 2 recipients to use sender key.</string>
|
||||
<string name="preferences__internal_calling" translatable="false">Group call server</string>
|
||||
<string name="preferences__internal_calling_default" translatable="false">Default</string>
|
||||
<string name="preferences__internal_calling_s_server" translatable="false">%1$s server</string>
|
||||
|
||||
<!-- Payments -->
|
||||
<string name="PaymentsActivityFragment__all_activity">All activity</string>
|
||||
|
|
Ładowanie…
Reference in New Issue