@@ -251,8 +251,7 @@ const CallButtons: FC<CallButtonsProps> = ({ room }) => {
251251 const [ busy , setBusy ] = useState ( false ) ;
252252 const showButtons = useSettingValue < boolean > ( "showCallButtonsInComposer" ) ;
253253 const groupCallsEnabled = useFeatureEnabled ( "feature_group_calls" ) ;
254- const videoRoomsEnabled = useFeatureEnabled ( "feature_video_rooms" ) ;
255- const isVideoRoom = useMemo ( ( ) => videoRoomsEnabled && calcIsVideoRoom ( room ) , [ videoRoomsEnabled , room ] ) ;
254+ const isVideoRoom = useMemo ( ( ) => calcIsVideoRoom ( room ) , [ room ] ) ;
256255 const useElementCallExclusively = useMemo ( ( ) => {
257256 return SdkConfig . get ( "element_call" ) . use_exclusively ;
258257 } , [ ] ) ;
@@ -290,53 +289,13 @@ const CallButtons: FC<CallButtonsProps> = ({ room }) => {
290289
291290 if ( isVideoRoom || ! showButtons ) {
292291 return null ;
293- } else if ( groupCallsEnabled ) {
294- if ( useElementCallExclusively ) {
295- if ( hasGroupCall ) {
296- return makeVideoCallButton ( new DisabledWithReason ( _t ( "voip|disabled_ongoing_call" ) ) ) ;
297- } else if ( mayCreateElementCalls ) {
298- return makeVideoCallButton ( "element" ) ;
299- } else {
300- return makeVideoCallButton ( new DisabledWithReason ( _t ( "voip|disabled_no_perms_start_video_call" ) ) ) ;
301- }
302- } else if ( hasLegacyCall || hasJitsiWidget ) {
303- return (
304- < >
305- { makeVoiceCallButton ( new DisabledWithReason ( _t ( "voip|disabled_ongoing_call" ) ) ) }
306- { makeVideoCallButton ( new DisabledWithReason ( _t ( "voip|disabled_ongoing_call" ) ) ) }
307- </ >
308- ) ;
309- } else if ( functionalMembers . length <= 1 ) {
310- return (
311- < >
312- { makeVoiceCallButton ( new DisabledWithReason ( _t ( "voip|disabled_no_one_here" ) ) ) }
313- { makeVideoCallButton ( new DisabledWithReason ( _t ( "voip|disabled_no_one_here" ) ) ) }
314- </ >
315- ) ;
316- } else if ( functionalMembers . length === 2 ) {
317- return (
318- < >
319- { makeVoiceCallButton ( "legacy_or_jitsi" ) }
320- { makeVideoCallButton ( "legacy_or_element" ) }
321- </ >
322- ) ;
323- } else if ( mayEditWidgets ) {
324- return (
325- < >
326- { makeVoiceCallButton ( "legacy_or_jitsi" ) }
327- { makeVideoCallButton ( mayCreateElementCalls ? "jitsi_or_element" : "legacy_or_jitsi" ) }
328- </ >
329- ) ;
292+ } else if ( groupCallsEnabled && useElementCallExclusively ) {
293+ if ( hasGroupCall ) {
294+ return makeVideoCallButton ( new DisabledWithReason ( _t ( "voip|disabled_ongoing_call" ) ) ) ;
295+ } else if ( mayCreateElementCalls ) {
296+ return makeVideoCallButton ( "element" ) ;
330297 } else {
331- const videoCallBehavior = mayCreateElementCalls
332- ? "element"
333- : new DisabledWithReason ( _t ( "voip|disabled_no_perms_start_video_call" ) ) ;
334- return (
335- < >
336- { makeVoiceCallButton ( new DisabledWithReason ( _t ( "voip|disabled_no_perms_start_voice_call" ) ) ) }
337- { makeVideoCallButton ( videoCallBehavior ) }
338- </ >
339- ) ;
298+ return makeVideoCallButton ( new DisabledWithReason ( _t ( "voip|disabled_no_perms_start_video_call" ) ) ) ;
340299 }
341300 } else if ( hasLegacyCall || hasJitsiWidget ) {
342301 return (
@@ -352,18 +311,31 @@ const CallButtons: FC<CallButtonsProps> = ({ room }) => {
352311 { makeVideoCallButton ( new DisabledWithReason ( _t ( "voip|disabled_no_one_here" ) ) ) }
353312 </ >
354313 ) ;
355- } else if ( functionalMembers . length === 2 || mayEditWidgets ) {
314+ } else if ( functionalMembers . length === 2 ) {
315+ return (
316+ < >
317+ { makeVoiceCallButton ( "legacy_or_jitsi" ) }
318+ { makeVideoCallButton ( groupCallsEnabled ? "legacy_or_element" : "legacy_or_jitsi" ) }
319+ </ >
320+ ) ;
321+ } else if ( mayEditWidgets ) {
356322 return (
357323 < >
358324 { makeVoiceCallButton ( "legacy_or_jitsi" ) }
359- { makeVideoCallButton ( "legacy_or_jitsi" ) }
325+ { makeVideoCallButton (
326+ groupCallsEnabled && mayCreateElementCalls ? "jitsi_or_element" : "legacy_or_jitsi" ,
327+ ) }
360328 </ >
361329 ) ;
362330 } else {
331+ const videoCallBehavior =
332+ groupCallsEnabled && mayCreateElementCalls
333+ ? "element"
334+ : new DisabledWithReason ( _t ( "voip|disabled_no_perms_start_video_call" ) ) ;
363335 return (
364336 < >
365337 { makeVoiceCallButton ( new DisabledWithReason ( _t ( "voip|disabled_no_perms_start_voice_call" ) ) ) }
366- { makeVideoCallButton ( new DisabledWithReason ( _t ( "voip|disabled_no_perms_start_video_call" ) ) ) }
338+ { makeVideoCallButton ( videoCallBehavior ) }
367339 </ >
368340 ) ;
369341 }
@@ -745,7 +717,7 @@ export default class RoomHeader extends React.Component<IProps, IState> {
745717 }
746718
747719 public render ( ) : React . ReactNode {
748- const isVideoRoom = SettingsStore . getValue ( "feature_video_rooms" ) && calcIsVideoRoom ( this . props . room ) ;
720+ const isVideoRoom = calcIsVideoRoom ( this . props . room ) ;
749721
750722 let roomAvatar : JSX . Element | null = null ;
751723 if ( this . props . room ) {
0 commit comments