chore: take out voice chat

Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
Infi 2025-07-23 03:09:05 +02:00
parent d3a0ef5db3
commit 684970ca32
3 changed files with 33 additions and 21 deletions

View File

@ -56,6 +56,19 @@ sealed class MassMentionsVariates {
object Disabled : MassMentionsVariates()
}
@FeatureFlag("VoiceChannels2_0")
sealed class VoiceChannels2_0Variates {
@Treatment(
"Enable the new voice channels 2.0 for all users"
)
object Enabled : VoiceChannels2_0Variates()
@Treatment(
"Disable the new voice channels 2.0 for all users"
)
object Disabled : VoiceChannels2_0Variates()
}
object FeatureFlags {
@FeatureFlag("LabsAccessControl")
var labsAccessControl by mutableStateOf<LabsAccessControlVariates>(
@ -97,11 +110,21 @@ object FeatureFlags {
@FeatureFlag("MassMentions")
var massMentions by mutableStateOf<MassMentionsVariates>(
MassMentionsVariates.Enabled
MassMentionsVariates.Disabled
)
val massMentionsGranted: Boolean
get() = when (massMentions) {
is MassMentionsVariates.Enabled -> true
is MassMentionsVariates.Disabled -> false
}
@FeatureFlag("VoiceChannels2_0")
var voiceChannels2_0 by mutableStateOf<VoiceChannels2_0Variates>(
VoiceChannels2_0Variates.Disabled
)
val voiceChannels2_0Granted: Boolean
get() = when (voiceChannels2_0) {
is VoiceChannels2_0Variates.Enabled -> true
is VoiceChannels2_0Variates.Disabled -> false
}
}

View File

@ -1,31 +1,16 @@
package chat.revolt.composables.voice
import androidx.compose.animation.animateContentSize
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewmodel.compose.viewModel
import chat.revolt.R
import chat.revolt.api.routes.misc.getRootRoute
import chat.revolt.api.routes.voice.joinCall
import io.livekit.android.compose.local.RoomLocal
import io.livekit.android.compose.local.RoomScope
import io.livekit.android.compose.state.rememberTracks
import io.livekit.android.compose.ui.VideoTrackView
import logcat.LogPriority
import logcat.asLog
import logcat.logcat
@ -93,7 +78,9 @@ fun VoiceSheet(
viewModel.getVoiceToken()
}
RoomScope(
// TODO - Voice channels are not supported yet
LaunchedEffect(Unit) { onDisconnect() }
/*RoomScope(
url = viewModel.voiceLkNode,
token = viewModel.voiceToken,
audio = true,
@ -146,5 +133,5 @@ fun VoiceSheet(
}
}
}
}
}*/
}

View File

@ -124,6 +124,7 @@ import chat.revolt.api.routes.channel.react
import chat.revolt.api.routes.microservices.autumn.FileArgs
import chat.revolt.api.schemas.ChannelType
import chat.revolt.api.schemas.Message
import chat.revolt.api.settings.FeatureFlags
import chat.revolt.callbacks.Action
import chat.revolt.callbacks.ActionChannel
import chat.revolt.composables.chat.DateDivider
@ -157,7 +158,6 @@ import com.valentinilk.shimmer.shimmer
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.launch
import kotlinx.datetime.Instant
import logcat.logcat
import java.io.File
import kotlin.math.max
@ -936,7 +936,9 @@ fun ChannelScreen(
}
}
if (viewModel.channel?.channelType == ChannelType.VoiceChannel) {
if (viewModel.channel?.channelType == ChannelType.VoiceChannel
&& FeatureFlags.voiceChannels2_0Granted
) {
JoinVoiceChannelButton(channelId)
}
}
@ -984,7 +986,7 @@ fun ChannelScreen(
onToggleSpoiler = {
val index = viewModel.draftAttachments
.indexOfFirst { a -> a.pickerIdentifier == it.pickerIdentifier }
if (index != -1) {
val attachment =
viewModel.draftAttachments[index]