feat: hide call buttons in chats with more than 5 members
Full-mesh WebRTC group calls degrade at 5+ participants (each participant uploads N-1 streams). Hide the voice and video call buttons in the chat header when the room has more than 5 members. https://claude.ai/code/session_013h2E7spwHDgSjunqumsYgp
This commit is contained in:
+3
-2
@@ -50,6 +50,7 @@ fun ChatroomScreen(
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
val isGroupChat = roomId.users.size > 1
|
||||
val isCallSupported = roomId.users.size <= 5
|
||||
val startVoiceCall =
|
||||
rememberCallWithPermission(context) {
|
||||
ActiveCallHolder.set(accountViewModel.callManager, accountViewModel.callController, accountViewModel)
|
||||
@@ -80,8 +81,8 @@ fun ChatroomScreen(
|
||||
room = roomId,
|
||||
accountViewModel = accountViewModel,
|
||||
nav = nav,
|
||||
onCallClick = { _ -> startVoiceCall() },
|
||||
onVideoCallClick = { _ -> startVideoCall() },
|
||||
onCallClick = if (isCallSupported) ({ _ -> startVoiceCall() }) else null,
|
||||
onVideoCallClick = if (isCallSupported) ({ _ -> startVideoCall() }) else null,
|
||||
)
|
||||
},
|
||||
accountViewModel = accountViewModel,
|
||||
|
||||
Reference in New Issue
Block a user