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 context = LocalContext.current
|
||||||
val isGroupChat = roomId.users.size > 1
|
val isGroupChat = roomId.users.size > 1
|
||||||
|
val isCallSupported = roomId.users.size <= 5
|
||||||
val startVoiceCall =
|
val startVoiceCall =
|
||||||
rememberCallWithPermission(context) {
|
rememberCallWithPermission(context) {
|
||||||
ActiveCallHolder.set(accountViewModel.callManager, accountViewModel.callController, accountViewModel)
|
ActiveCallHolder.set(accountViewModel.callManager, accountViewModel.callController, accountViewModel)
|
||||||
@@ -80,8 +81,8 @@ fun ChatroomScreen(
|
|||||||
room = roomId,
|
room = roomId,
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
nav = nav,
|
nav = nav,
|
||||||
onCallClick = { _ -> startVoiceCall() },
|
onCallClick = if (isCallSupported) ({ _ -> startVoiceCall() }) else null,
|
||||||
onVideoCallClick = { _ -> startVideoCall() },
|
onVideoCallClick = if (isCallSupported) ({ _ -> startVideoCall() }) else null,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
|
|||||||
Reference in New Issue
Block a user