File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ default : minor
3+ ---
4+
5+ Added a toggle to enable/disable showing the call button for large (> 10 member) rooms.
Original file line number Diff line number Diff line change @@ -361,6 +361,8 @@ export function RoomViewHeader({ callView }: { callView?: boolean }) {
361361 . getLiveTimeline ( )
362362 . getState ( EventTimeline . FORWARDS )
363363 ?. maySendStateEvent ( 'org.matrix.msc3401.call.member' , mx . getUserId ( ) ! ) ;
364+ const [ alwaysShowCallButton ] = useSetting ( settingsAtom , 'alwaysShowCallButton' ) ;
365+ const shouldShowCallButton = alwaysShowCallButton || room . getJoinedMemberCount ( ) <= 10 ;
364366
365367 const encryptionEvent = useStateEvent ( room , StateEvent . RoomEncryption ) ;
366368 const encryptedRoom = ! ! encryptionEvent ;
@@ -708,7 +710,7 @@ export function RoomViewHeader({ callView }: { callView?: boolean }) {
708710 </ IconButton >
709711 ) }
710712 </ TooltipProvider >
711- { canUseCalls && < RoomCallButton room = { room } /> }
713+ { canUseCalls && shouldShowCallButton && < RoomCallButton room = { room } /> }
712714 < PopOut
713715 anchor = { pinMenuAnchor }
714716 position = "Bottom"
Original file line number Diff line number Diff line change @@ -823,6 +823,31 @@ function EmojiSelectorThresholdInput() {
823823 ) ;
824824}
825825
826+ function Calls ( ) {
827+ const [ alwaysShowCallButton , setAlwaysShowCallButton ] = useSetting (
828+ settingsAtom ,
829+ 'alwaysShowCallButton'
830+ ) ;
831+
832+ return (
833+ < Box direction = "Column" gap = "100" >
834+ < Text size = "L400" > Calls</ Text >
835+ < SequenceCard className = { SequenceCardStyle } variant = "SurfaceVariant" direction = "Column" >
836+ < SettingTile
837+ title = "Show Call Button for Large Rooms"
838+ after = {
839+ < Switch
840+ variant = "Primary"
841+ value = { alwaysShowCallButton }
842+ onChange = { setAlwaysShowCallButton }
843+ />
844+ }
845+ />
846+ </ SequenceCard >
847+ </ Box >
848+ ) ;
849+ }
850+
826851function Messages ( ) {
827852 const [ hideMembershipEvents , setHideMembershipEvents ] = useSetting (
828853 settingsAtom ,
@@ -1078,6 +1103,7 @@ export function General({ requestClose }: GeneralProps) {
10781103 < Gestures isMobile = { mobileOrTablet ( ) } />
10791104 < Editor isMobile = { mobileOrTablet ( ) } />
10801105 < Messages />
1106+ < Calls />
10811107 </ Box >
10821108 </ PageContent >
10831109 </ Scroll >
Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ export interface Settings {
9696 autoplayStickers : boolean ;
9797 autoplayEmojis : boolean ;
9898 saveStickerEmojiBandwidth : boolean ;
99+ alwaysShowCallButton : boolean ;
99100
100101 // furry stuff
101102 renderAnimals : boolean ;
@@ -176,6 +177,7 @@ const defaultSettings: Settings = {
176177 autoplayStickers : true ,
177178 autoplayEmojis : true ,
178179 saveStickerEmojiBandwidth : false ,
180+ alwaysShowCallButton : false ,
179181
180182 // furry stuff
181183 renderAnimals : true ,
You can’t perform that action at this time.
0 commit comments