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:
Claude
2026-04-03 12:25:47 +00:00
parent 0dc38de839
commit 23e8ef6169
@@ -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,