mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-21 17:41:25 -08:00
adjust ringtone settings a little
This commit is contained in:
1 parent
2865af25c1
commit
3a8d310e75
4 files changed
+13
-5
No files matched your search
@@ -28,9 +28,8 @@ export const CALL_RINGTONE_OPTIONS: CallToneOption<CallRingtoneId>[] = CALL_TONE
|
||||
})
|
||||
);
|
||||
|
||||
export const CALL_RINGBACK_OPTIONS: CallToneOption<CallRingtoneId>[] = CALL_RINGTONE_OPTIONS.filter(
|
||||
(option) => option.value !== 'silent'
|
||||
);
|
||||
export const CALL_RINGBACK_OPTIONS: CallToneOption<CallRingtoneId>[] =
|
||||
CALL_RINGTONE_OPTIONS;
|
||||
|
||||
type ToneSettings = Pick<Settings, 'isNotificationSounds' | 'callSoundOverrideGlobalNotifications'>;
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ export type OutgoingRingbackContext = {
|
||||
declinedRoomId: string | null;
|
||||
hasCallBeenActive: boolean;
|
||||
getRoom: (roomId: string) => Room | null | undefined;
|
||||
isDirectRoom: (roomId: string) => boolean;
|
||||
getSessionDescription: (room: Room) => SessionDescription;
|
||||
isOutgoingPending?: typeof isOutgoingCallPending;
|
||||
isCallActive?: typeof isCallActive;
|
||||
@@ -87,6 +88,11 @@ export const evaluateOutgoingRingbackFallback = (
|
||||
return stop();
|
||||
}
|
||||
|
||||
// Only direct (1:1) calls should play an outgoing ringback tone. Voice rooms should not ring.
|
||||
if (!context.isDirectRoom(context.activeCallRoomId)) {
|
||||
return stop();
|
||||
}
|
||||
|
||||
const outgoingRoom = context.getRoom(context.activeCallRoomId);
|
||||
if (!outgoingRoom) {
|
||||
return stop();
|
||||
|
||||
@@ -377,7 +377,6 @@ export function CallSoundSettings() {
|
||||
previewing={previewing}
|
||||
previewActions={[
|
||||
{ label: 'Preview Ringtone', tone: 'incoming', icon: Icons.Play },
|
||||
{ label: 'Preview Outgoing', tone: 'outgoing', icon: Icons.Phone },
|
||||
]}
|
||||
onImport={handleImportCustomRingtone}
|
||||
onPreview={playPreviewTone}
|
||||
|
||||
@@ -293,7 +293,10 @@ export function useIncomingCallSignaling() {
|
||||
callSoundOverrideGlobalNotifications: settings.callSoundOverrideGlobalNotifications,
|
||||
});
|
||||
const incomingRingtoneAllowed = settings.incomingCallSoundEnabled && callAudioAllowed;
|
||||
const outgoingRingbackAllowed = settings.outgoingRingbackEnabled && callAudioAllowed;
|
||||
const outgoingRingbackAllowed =
|
||||
settings.outgoingRingbackEnabled &&
|
||||
callAudioAllowed &&
|
||||
settings.callRingbackTone !== 'silent';
|
||||
const incomingToneIsSilent = settings.callRingtoneId === 'silent';
|
||||
|
||||
const handleIncomingCall = useCallback(
|
||||
@@ -579,6 +582,7 @@ export function useIncomingCallSignaling() {
|
||||
{
|
||||
...fallbackContext,
|
||||
activeCallRoomId,
|
||||
isDirectRoom: (roomId: string) => handlers().mDirects.has(roomId),
|
||||
outgoingRingbackAllowed: handlers().outgoingRingbackAllowed,
|
||||
declinedRoomId: declinedOutgoingRoomIdRef.current,
|
||||
hasCallBeenActive: hasCallBeenActiveRef.current,
|
||||
|
||||
Reference in new issue
Block a user