From 23e8ef61699036c47cff547d8e209398b86fd39b Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 3 Apr 2026 12:25:47 +0000 Subject: [PATCH] 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 --- .../ui/screen/loggedIn/chats/privateDM/ChatroomScreen.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/ChatroomScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/ChatroomScreen.kt index 01189b2a9..10fe6ef71 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/ChatroomScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/privateDM/ChatroomScreen.kt @@ -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,