Skip to content

Commit d19d221

Browse files
committed
use RTCNotification event
1 parent f1c2945 commit d19d221

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
"livekit-client": "^2.13.0",
109109
"lodash-es": "^4.17.21",
110110
"loglevel": "^1.9.1",
111-
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#head=develop",
111+
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#bf95e553c4a84ae5282c3b5f191d6132b127c19b",
112112
"matrix-widget-api": "^1.13.0",
113113
"normalize.css": "^8.0.1",
114114
"observable-hooks": "^4.2.3",

src/rtcSessionHelpers.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
55
Please see LICENSE in the repository root for full details.
66
*/
77

8-
import { type MatrixRTCSession } from "matrix-js-sdk/lib/matrixrtc";
8+
import {
9+
type RTCNotificationType,
10+
type MatrixRTCSession,
11+
} from "matrix-js-sdk/lib/matrixrtc";
912
import { logger } from "matrix-js-sdk/lib/logger";
1013
import {
1114
isLivekitFocus,
@@ -14,6 +17,7 @@ import {
1417
type LivekitFocusActive,
1518
} from "matrix-js-sdk/lib/matrixrtc";
1619
import { AutoDiscovery } from "matrix-js-sdk/lib/autodiscovery";
20+
import { type Room } from "matrix-js-sdk";
1721

1822
import { PosthogAnalytics } from "./analytics/PosthogAnalytics";
1923
import { Config } from "./config/Config";
@@ -95,10 +99,12 @@ async function makePreferredLivekitFoci(
9599
// if (focusOtherMembers) preferredFoci.push(focusOtherMembers);
96100
}
97101

98-
function getNotifyType(room: Room): CallNotifyType | undefined {
102+
function getRTCNotificationType(
103+
room: Room,
104+
): Exclude<RTCNotificationType, "decline"> | undefined {
99105
if (room.isCallRoom()) return undefined;
100106
if (getJoinedNonFunctionalMembers(room).length === 2) return "ring";
101-
return "notify";
107+
return "notification";
102108
}
103109

104110
export async function enterRTCSession(
@@ -123,7 +129,7 @@ export async function enterRTCSession(
123129
await makePreferredLivekitFoci(rtcSession, livekitAlias),
124130
makeActiveFocus(),
125131
{
126-
notifyType: getNotifyType(rtcSession.room),
132+
notificationType: getRTCNotificationType(rtcSession.room),
127133
useNewMembershipManager,
128134
manageMediaKeys: encryptMedia,
129135
...(useDeviceSessionMemberEvents !== undefined && {

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7504,7 +7504,7 @@ __metadata:
75047504
livekit-client: "npm:^2.13.0"
75057505
lodash-es: "npm:^4.17.21"
75067506
loglevel: "npm:^1.9.1"
7507-
matrix-js-sdk: "github:matrix-org/matrix-js-sdk#head=develop"
7507+
matrix-js-sdk: "github:matrix-org/matrix-js-sdk#bf95e553c4a84ae5282c3b5f191d6132b127c19b"
75087508
matrix-widget-api: "npm:^1.13.0"
75097509
normalize.css: "npm:^8.0.1"
75107510
observable-hooks: "npm:^4.2.3"
@@ -10245,9 +10245,9 @@ __metadata:
1024510245
languageName: node
1024610246
linkType: hard
1024710247

10248-
"matrix-js-sdk@github:matrix-org/matrix-js-sdk#head=develop":
10249-
version: 37.10.0
10250-
resolution: "matrix-js-sdk@https://github.com/matrix-org/matrix-js-sdk.git#commit=090b8079db2aaed4638912c22e3e971b367437b6"
10248+
"matrix-js-sdk@github:matrix-org/matrix-js-sdk#bf95e553c4a84ae5282c3b5f191d6132b127c19b":
10249+
version: 37.11.0
10250+
resolution: "matrix-js-sdk@https://github.com/matrix-org/matrix-js-sdk.git#commit=bf95e553c4a84ae5282c3b5f191d6132b127c19b"
1025110251
dependencies:
1025210252
"@babel/runtime": "npm:^7.12.5"
1025310253
"@matrix-org/matrix-sdk-crypto-wasm": "npm:^15.0.0"
@@ -10263,7 +10263,7 @@ __metadata:
1026310263
sdp-transform: "npm:^2.14.1"
1026410264
unhomoglyph: "npm:^1.0.6"
1026510265
uuid: "npm:11"
10266-
checksum: 10c0/8b532fc305af30ca62a567c01f0b807b4856ef5fe20680f2b77895981f35f0a973899208d8e2ac7f4f320391d2bb4cdafc0226dab0524a77437ec2b334413b99
10266+
checksum: 10c0/7b82783d4b35f33b463615001bb4eac1db113cf76a0df1401f4ac7eec65c121385da1ab1f767929beb83cf072c7d2b4e537dcf5519510ed7a25363875965142d
1026710267
languageName: node
1026810268
linkType: hard
1026910269

0 commit comments

Comments
 (0)