Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/feat-large-room-call-button.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: minor
---

Added a toggle to enable/disable showing the call button for large (> 10 member) rooms.
4 changes: 3 additions & 1 deletion src/app/features/room/RoomViewHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ export function RoomViewHeader({ callView }: { callView?: boolean }) {
.getLiveTimeline()
.getState(EventTimeline.FORWARDS)
?.maySendStateEvent('org.matrix.msc3401.call.member', mx.getUserId()!);
const [alwaysShowCallButton] = useSetting(settingsAtom, 'alwaysShowCallButton');
const shouldShowCallButton = alwaysShowCallButton || room.getJoinedMemberCount() <= 10;

const encryptionEvent = useStateEvent(room, StateEvent.RoomEncryption);
const encryptedRoom = !!encryptionEvent;
Expand Down Expand Up @@ -708,7 +710,7 @@ export function RoomViewHeader({ callView }: { callView?: boolean }) {
</IconButton>
)}
</TooltipProvider>
{canUseCalls && <RoomCallButton room={room} />}
{canUseCalls && shouldShowCallButton && <RoomCallButton room={room} />}
<PopOut
anchor={pinMenuAnchor}
position="Bottom"
Expand Down
26 changes: 26 additions & 0 deletions src/app/features/settings/general/General.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,31 @@ function EmojiSelectorThresholdInput() {
);
}

function Calls() {
const [alwaysShowCallButton, setAlwaysShowCallButton] = useSetting(
settingsAtom,
'alwaysShowCallButton'
);

return (
<Box direction="Column" gap="100">
<Text size="L400">Calls</Text>
<SequenceCard className={SequenceCardStyle} variant="SurfaceVariant" direction="Column">
<SettingTile
title="Show Call Button for Large Rooms"
after={
<Switch
variant="Primary"
value={alwaysShowCallButton}
onChange={setAlwaysShowCallButton}
/>
}
/>
</SequenceCard>
</Box>
);
}

function Messages() {
const [hideMembershipEvents, setHideMembershipEvents] = useSetting(
settingsAtom,
Expand Down Expand Up @@ -1078,6 +1103,7 @@ export function General({ requestClose }: GeneralProps) {
<Gestures isMobile={mobileOrTablet()} />
<Editor isMobile={mobileOrTablet()} />
<Messages />
<Calls />
</Box>
</PageContent>
</Scroll>
Expand Down
2 changes: 2 additions & 0 deletions src/app/state/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export interface Settings {
autoplayStickers: boolean;
autoplayEmojis: boolean;
saveStickerEmojiBandwidth: boolean;
alwaysShowCallButton: boolean;

// furry stuff
renderAnimals: boolean;
Expand Down Expand Up @@ -176,6 +177,7 @@ const defaultSettings: Settings = {
autoplayStickers: true,
autoplayEmojis: true,
saveStickerEmojiBandwidth: false,
alwaysShowCallButton: false,

// furry stuff
renderAnimals: true,
Expand Down
Loading