matrix-js-sdk 43.0.0 → 44.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/matrixrtc/CallMembership.d.ts +30 -25
- package/lib/matrixrtc/CallMembership.d.ts.map +1 -1
- package/lib/matrixrtc/CallMembership.js +91 -100
- package/lib/matrixrtc/CallMembership.js.map +1 -1
- package/lib/matrixrtc/EncryptionManager.d.ts +6 -4
- package/lib/matrixrtc/EncryptionManager.d.ts.map +1 -1
- package/lib/matrixrtc/EncryptionManager.js.map +1 -1
- package/lib/matrixrtc/IMembershipManager.d.ts +2 -15
- package/lib/matrixrtc/IMembershipManager.d.ts.map +1 -1
- package/lib/matrixrtc/IMembershipManager.js.map +1 -1
- package/lib/matrixrtc/LivekitTransport.d.ts +36 -7
- package/lib/matrixrtc/LivekitTransport.d.ts.map +1 -1
- package/lib/matrixrtc/LivekitTransport.js +29 -2
- package/lib/matrixrtc/LivekitTransport.js.map +1 -1
- package/lib/matrixrtc/MatrixRTCSession.d.ts +12 -51
- package/lib/matrixrtc/MatrixRTCSession.d.ts.map +1 -1
- package/lib/matrixrtc/MatrixRTCSession.js +10 -66
- package/lib/matrixrtc/MatrixRTCSession.js.map +1 -1
- package/lib/matrixrtc/MembershipManager.d.ts +5 -10
- package/lib/matrixrtc/MembershipManager.d.ts.map +1 -1
- package/lib/matrixrtc/MembershipManager.js +25 -44
- package/lib/matrixrtc/MembershipManager.js.map +1 -1
- package/lib/matrixrtc/RTCEncryptionManager.d.ts +8 -8
- package/lib/matrixrtc/RTCEncryptionManager.d.ts.map +1 -1
- package/lib/matrixrtc/RTCEncryptionManager.js +30 -22
- package/lib/matrixrtc/RTCEncryptionManager.js.map +1 -1
- package/lib/matrixrtc/ToDeviceKeyTransport.js +7 -8
- package/lib/matrixrtc/ToDeviceKeyTransport.js.map +1 -1
- package/lib/matrixrtc/membershipData/rtc.d.ts +8 -13
- package/lib/matrixrtc/membershipData/rtc.d.ts.map +1 -1
- package/lib/matrixrtc/membershipData/rtc.js +2 -11
- package/lib/matrixrtc/membershipData/rtc.js.map +1 -1
- package/lib/matrixrtc/membershipData/session.d.ts +6 -2
- package/lib/matrixrtc/membershipData/session.d.ts.map +1 -1
- package/lib/matrixrtc/membershipData/session.js +3 -0
- package/lib/matrixrtc/membershipData/session.js.map +1 -1
- package/lib/matrixrtc/types.d.ts +5 -0
- package/lib/matrixrtc/types.d.ts.map +1 -1
- package/lib/matrixrtc/types.js +5 -0
- package/lib/matrixrtc/types.js.map +1 -1
- package/lib/models/event-timeline-set.d.ts +9 -2
- package/lib/models/event-timeline-set.d.ts.map +1 -1
- package/lib/models/event-timeline-set.js +8 -5
- package/lib/models/event-timeline-set.js.map +1 -1
- package/lib/models/room-sticky-events.d.ts +17 -2
- package/lib/models/room-sticky-events.d.ts.map +1 -1
- package/lib/models/room-sticky-events.js +88 -47
- package/lib/models/room-sticky-events.js.map +1 -1
- package/lib/models/room.d.ts +1 -1
- package/lib/models/room.d.ts.map +1 -1
- package/lib/models/room.js +8 -2
- package/lib/models/room.js.map +1 -1
- package/lib/models/thread.d.ts.map +1 -1
- package/lib/models/thread.js +23 -2
- package/lib/models/thread.js.map +1 -1
- package/lib/rendezvous/MSC4108SignInWithQR.d.ts +3 -3
- package/lib/rendezvous/MSC4108SignInWithQR.d.ts.map +1 -1
- package/lib/rendezvous/MSC4108SignInWithQR.js.map +1 -1
- package/lib/rendezvous/SignInWithQRFlow.d.ts +95 -0
- package/lib/rendezvous/SignInWithQRFlow.d.ts.map +1 -0
- package/lib/rendezvous/SignInWithQRFlow.js +3 -0
- package/lib/rendezvous/SignInWithQRFlow.js.map +1 -0
- package/lib/rendezvous/index.d.ts +1 -0
- package/lib/rendezvous/index.d.ts.map +1 -1
- package/lib/rendezvous/index.js.map +1 -1
- package/lib/rust-crypto/index.js +5 -1
- package/lib/rust-crypto/index.js.map +1 -1
- package/package.json +3 -3
- package/src/matrixrtc/CallMembership.ts +85 -95
- package/src/matrixrtc/EncryptionManager.ts +6 -4
- package/src/matrixrtc/IMembershipManager.ts +2 -15
- package/src/matrixrtc/LivekitTransport.ts +58 -9
- package/src/matrixrtc/MatrixRTCSession.ts +21 -80
- package/src/matrixrtc/MembershipManager.ts +23 -40
- package/src/matrixrtc/RTCEncryptionManager.ts +51 -39
- package/src/matrixrtc/ToDeviceKeyTransport.ts +7 -7
- package/src/matrixrtc/membershipData/rtc.ts +9 -23
- package/src/matrixrtc/membershipData/session.ts +14 -2
- package/src/matrixrtc/types.ts +6 -0
- package/src/models/event-timeline-set.ts +19 -4
- package/src/models/room-sticky-events.ts +92 -58
- package/src/models/room.ts +8 -2
- package/src/models/thread.ts +25 -3
- package/src/rendezvous/MSC4108SignInWithQR.ts +3 -3
- package/src/rendezvous/SignInWithQRFlow.ts +117 -0
- package/src/rendezvous/index.ts +1 -0
- package/src/rust-crypto/index.ts +5 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMembershipManager.d.ts","sourceRoot":"","sources":["../../src/matrixrtc/IMembershipManager.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,oBAAY,sBAAsB;IAC9B,aAAa,kBAAkB;IAC/B;;;;OAIG;IACH,YAAY,iBAAiB;IAC7B;;;OAGG;IACH,cAAc,mBAAmB;CACpC;AAED,MAAM,MAAM,gCAAgC,GAAG;IAC3C,CAAC,sBAAsB,CAAC,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACxF,CAAC,sBAAsB,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;IAC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AAI,YAAY,IAAI,OAAO,CAAC;IAE5B;;;OAGG;IACH,IAAI,OAAO,IAAI,MAAM,GAAG,SAAS,CAAC;IAElC;;;;OAIG;IACH,IAAI,CAAC,mBAAmB,EAAE,SAAS,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI,CAAC;IACjF;;;;;OAKG;IACH,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1C;;OAEG;IACH,wBAAwB,CAAC,WAAW,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvE;;;OAGG;IACH,gBAAgB,CAAC,UAAU,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3D;;;OAGG;IACH,qBAAqB,CAAC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMembershipManager.js","names":[],"sources":["../../src/matrixrtc/IMembershipManager.ts"],"sourcesContent":["/*\nCopyright 2025 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport type { CallMembership } from \"./CallMembership.ts\";\nimport type { RTCCallIntent, Status, Transport } from \"./types.ts\";\nimport { type TypedEventEmitter } from \"../models/typed-event-emitter.ts\";\n\nexport enum MembershipManagerEvent {\n StatusChanged = \"StatusChanged\",\n /**\n * Emitted when the membership manager has not heard back from the server for the duration\n * of the delayed event and hence failed to restart the delayed event.\n * This means that the user is probably not joined anymore and the leave event was distributed to other session members.\n */\n ProbablyLeft = \"ProbablyLeft\",\n /**\n * Once the membershipManger has aquired the a delay id (after sending the state event)\n * It will emit and share the delay id.\n */\n DelayIdChanged = \"DelayIdChanged\",\n}\n\nexport type MembershipManagerEventHandlerMap = {\n [MembershipManagerEvent.StatusChanged]: (prefStatus: Status, newStatus: Status) => void;\n [MembershipManagerEvent.ProbablyLeft]: (probablyLeft: boolean) => void;\n [MembershipManagerEvent.DelayIdChanged]: (delayId: string | undefined) => void;\n};\n\n/**\n * This interface defines what a MembershipManager uses and exposes.\n * This interface is what we use to write tests and allows changing the actual implementation\n * without breaking tests because of some internal method renaming.\n *\n * @internal\n */\nexport interface IMembershipManager extends TypedEventEmitter<\n MembershipManagerEvent,\n MembershipManagerEventHandlerMap\n> {\n /**\n * If
|
|
1
|
+
{"version":3,"file":"IMembershipManager.js","names":[],"sources":["../../src/matrixrtc/IMembershipManager.ts"],"sourcesContent":["/*\nCopyright 2025 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport type { CallMembership } from \"./CallMembership.ts\";\nimport type { RTCCallIntent, Status, Transport } from \"./types.ts\";\nimport { type TypedEventEmitter } from \"../models/typed-event-emitter.ts\";\n\nexport enum MembershipManagerEvent {\n StatusChanged = \"StatusChanged\",\n /**\n * Emitted when the membership manager has not heard back from the server for the duration\n * of the delayed event and hence failed to restart the delayed event.\n * This means that the user is probably not joined anymore and the leave event was distributed to other session members.\n */\n ProbablyLeft = \"ProbablyLeft\",\n /**\n * Once the membershipManger has aquired the a delay id (after sending the state event)\n * It will emit and share the delay id.\n */\n DelayIdChanged = \"DelayIdChanged\",\n}\n\nexport type MembershipManagerEventHandlerMap = {\n [MembershipManagerEvent.StatusChanged]: (prefStatus: Status, newStatus: Status) => void;\n [MembershipManagerEvent.ProbablyLeft]: (probablyLeft: boolean) => void;\n [MembershipManagerEvent.DelayIdChanged]: (delayId: string | undefined) => void;\n};\n\n/**\n * This interface defines what a MembershipManager uses and exposes.\n * This interface is what we use to write tests and allows changing the actual implementation\n * without breaking tests because of some internal method renaming.\n *\n * @internal\n */\nexport interface IMembershipManager extends TypedEventEmitter<\n MembershipManagerEvent,\n MembershipManagerEventHandlerMap\n> {\n /**\n * If the manager is activated. This means it tries to do its job to join the call, resend state events...\n * It does not imply that the room state is already configured to represent being joined.\n * It means that the Manager tries to connect or is connected. (\"the manager is still active\")\n * Once `leave()` is called the manager is not activated anymore but still running until `leave()` resolves.\n * @returns `true` if we intend to be participating in the MatrixRTC session\n */\n isActivated(): boolean;\n /**\n * Get the actual connection status of the manager.\n */\n get status(): Status;\n\n /**\n * The Current own state event if the manger is connected.\n * `undefined` if not connected.\n */\n get ownMembership(): CallMembership | undefined;\n\n /**\n * If the membership manager has reason to believe that the hs sent a leave event\n * and as a consequence the current user is perceived as left for other session participants.\n */\n get probablyLeft(): boolean;\n\n /**\n * If the membership manager has reason to believe that the hs sent a leave event\n * and as a consequence the current user is perceived as left for other session participants.\n */\n get delayId(): string | undefined;\n\n /**\n * Start sending all necessary events to make this user participate in the RTC session.\n * @param publishedTransports the list of transports on which the member is publishing.\n * @throws can throw if it exceeds a configured maximum retry.\n */\n join(publishedTransports: Transport[], onError?: (error: unknown) => void): void;\n /**\n * Send all necessary events to make this user leave the RTC session.\n * @param timeout the maximum duration in ms until the promise is forced to resolve.\n * @returns It resolves with true in case the leave was sent successfully.\n * It resolves with false in case we hit the timeout before sending successfully.\n */\n leave(timeout?: number): Promise<boolean>;\n /**\n * Call this if the MatrixRTC session members have changed.\n */\n onRTCSessionMemberUpdate(memberships: CallMembership[]): Promise<void>;\n\n /**\n * Update the intent of a membership on the call (e.g. user is now providing a video feed)\n * @param callIntent The new intent to set.\n */\n updateCallIntent(callIntent: RTCCallIntent): Promise<void>;\n\n /**\n * Replace the application-specific data of our membership (see\n * `SessionConfig.applicationData`), re-sending the membership if it changed.\n */\n updateApplicationData(applicationData: Record<string, unknown>): Promise<void>;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,WAAY,sBAAsB,0BAAtB,sBAAsB;EAAtB,sBAAsB;EAE9B;AACJ;AACA;AACA;AACA;EANY,sBAAsB;EAQ9B;AACJ;AACA;AACA;EAXY,sBAAsB;EAAA,OAAtB,sBAAsB;AAAA;;AAqBlC;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -1,20 +1,48 @@
|
|
|
1
1
|
import { type Transport } from "./types.ts";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use {@link UnstableLivekitTransport} instead, which has multiple
|
|
4
|
+
* variants to support the migration to newer versions of MSC4195.
|
|
5
|
+
*/
|
|
6
|
+
export interface LivekitTransport extends Transport {
|
|
3
7
|
type: "livekit";
|
|
4
8
|
livekit_service_url: string;
|
|
5
9
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Use {@link isUnstableLivekitTransport} instead.
|
|
12
|
+
*/
|
|
13
|
+
export declare const isLivekitTransport: (object: unknown) => object is LivekitTransport;
|
|
14
|
+
type WebsocketUrl = {
|
|
15
|
+
/**
|
|
16
|
+
* WebSocket URL of the LiveKit server.
|
|
17
|
+
*/
|
|
18
|
+
url: string;
|
|
19
|
+
};
|
|
20
|
+
type ServiceUrl = {
|
|
21
|
+
/**
|
|
22
|
+
* Base URL of the LiveKit JWT service.
|
|
23
|
+
*/
|
|
24
|
+
livekit_service_url: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Any LiveKit transport that can be advertised by a homeserver or published by
|
|
28
|
+
* a session member in unstable MSC4195 implementations: `url` only,
|
|
29
|
+
* `livekit_service_url` only, or both during the migration.
|
|
30
|
+
*/
|
|
31
|
+
export type UnstableLivekitTransport = ({
|
|
32
|
+
type: "livekit";
|
|
33
|
+
} & WebsocketUrl) | ({
|
|
34
|
+
type: "livekit";
|
|
35
|
+
} & ServiceUrl) | ({
|
|
36
|
+
type: "livekit";
|
|
37
|
+
} & WebsocketUrl & ServiceUrl);
|
|
38
|
+
export declare const isUnstableLivekitTransport: (object: unknown) => object is UnstableLivekitTransport;
|
|
11
39
|
/**
|
|
12
40
|
* @deprecated this is just needed for the old focus active / focus fields of a call membership.
|
|
13
41
|
* Not needed for new implementations.
|
|
14
42
|
*/
|
|
15
43
|
export interface LivekitFocusSelection extends Transport {
|
|
16
44
|
type: "livekit";
|
|
17
|
-
focus_selection: "
|
|
45
|
+
focus_selection: "multi_sfu";
|
|
18
46
|
}
|
|
19
47
|
/**
|
|
20
48
|
* @deprecated see LivekitFocusSelection
|
|
@@ -102,4 +130,5 @@ export type LivekitDelegateDelayedLeaveRequest = {
|
|
|
102
130
|
*/
|
|
103
131
|
delay_id: string;
|
|
104
132
|
};
|
|
133
|
+
export {};
|
|
105
134
|
//# sourceMappingURL=LivekitTransport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LivekitTransport.d.ts","sourceRoot":"","sources":["../../src/matrixrtc/LivekitTransport.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"LivekitTransport.d.ts","sourceRoot":"","sources":["../../src/matrixrtc/LivekitTransport.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;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E,gBAAgB,CAAC;IACzB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC7C;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,MAAM,EAAE,gBAAgB,CAAC;IACzB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -14,8 +14,35 @@ See the License for the specific language governing permissions and
|
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Use {@link UnstableLivekitTransport} instead, which has multiple
|
|
19
|
+
* variants to support the migration to newer versions of MSC4195.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Use {@link isUnstableLivekitTransport} instead.
|
|
24
|
+
*/
|
|
25
|
+
export const isLivekitTransport = object => {
|
|
26
|
+
if (typeof object !== "object" || object === null) return false;
|
|
27
|
+
const transport = object;
|
|
28
|
+
return transport.type === "livekit" && typeof transport.livekit_service_url === "string";
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Any LiveKit transport that can be advertised by a homeserver or published by
|
|
33
|
+
* a session member in unstable MSC4195 implementations: `url` only,
|
|
34
|
+
* `livekit_service_url` only, or both during the migration.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
export const isUnstableLivekitTransport = object => {
|
|
38
|
+
if (typeof object !== "object" || object === null) return false;
|
|
39
|
+
const transport = object;
|
|
40
|
+
if (transport.type !== "livekit") return false;
|
|
41
|
+
if (!("url" in transport || "livekit_service_url" in transport)) return false;
|
|
42
|
+
if ("url" in transport && typeof transport.url !== "string") return false;
|
|
43
|
+
if ("livekit_service_url" in transport && typeof transport.livekit_service_url !== "string") return false;
|
|
44
|
+
return true;
|
|
45
|
+
};
|
|
19
46
|
|
|
20
47
|
/**
|
|
21
48
|
* @deprecated this is just needed for the old focus active / focus fields of a call membership.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LivekitTransport.js","names":[],"sources":["../../src/matrixrtc/LivekitTransport.ts"],"sourcesContent":["/*\nCopyright 2025 New Vector Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { type Transport } from \"./types.ts\";\n\nexport interface
|
|
1
|
+
{"version":3,"file":"LivekitTransport.js","names":[],"sources":["../../src/matrixrtc/LivekitTransport.ts"],"sourcesContent":["/*\nCopyright 2025 New Vector Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport { type Transport } from \"./types.ts\";\n\n/**\n * @deprecated Use {@link UnstableLivekitTransport} instead, which has multiple\n * variants to support the migration to newer versions of MSC4195.\n */\nexport interface LivekitTransport extends Transport {\n type: \"livekit\";\n livekit_service_url: string;\n}\n\n/**\n * @deprecated Use {@link isUnstableLivekitTransport} instead.\n */\nexport const isLivekitTransport = (object: unknown): object is LivekitTransport => {\n if (typeof object !== \"object\" || object === null) return false;\n const transport = object as Transport;\n\n return transport.type === \"livekit\" && typeof transport.livekit_service_url === \"string\";\n};\n\ntype WebsocketUrl = {\n /**\n * WebSocket URL of the LiveKit server.\n */\n url: string;\n};\n\ntype ServiceUrl = {\n /**\n * Base URL of the LiveKit JWT service.\n */\n livekit_service_url: string;\n};\n\n/**\n * Any LiveKit transport that can be advertised by a homeserver or published by\n * a session member in unstable MSC4195 implementations: `url` only,\n * `livekit_service_url` only, or both during the migration.\n */\nexport type UnstableLivekitTransport =\n // Latest MSC4195 variant, with `url`. Indicates that both publishers and\n // subscribers will use the /_matrix/client/v1/rtc/livekit/get_token\n // endpoint.\n | ({ type: \"livekit\" } & WebsocketUrl)\n // Legacy variant, with `livekit_service_url`. Indicates that both\n // publishers and subscribers will use the endpoints of the provided LiveKit\n // JWT service.\n | ({ type: \"livekit\" } & ServiceUrl)\n // Transitional variant, with both `url` and `livekit_service_url`.\n // Indicates that both publishers and subscribers may use either the\n // /_matrix/client/v1/rtc/livekit/get_token endpoint or the provided LiveKit\n // JWT service.\n | ({ type: \"livekit\" } & WebsocketUrl & ServiceUrl);\n\nexport const isUnstableLivekitTransport = (object: unknown): object is UnstableLivekitTransport => {\n if (typeof object !== \"object\" || object === null) return false;\n const transport = object as Transport;\n\n if (transport.type !== \"livekit\") return false;\n if (!(\"url\" in transport || \"livekit_service_url\" in transport)) return false;\n if (\"url\" in transport && typeof transport.url !== \"string\") return false;\n if (\"livekit_service_url\" in transport && typeof transport.livekit_service_url !== \"string\") return false;\n return true;\n};\n\n/**\n * @deprecated this is just needed for the old focus active / focus fields of a call membership.\n * Not needed for new implementations.\n */\nexport interface LivekitFocusSelection extends Transport {\n type: \"livekit\";\n focus_selection: \"multi_sfu\";\n}\n/**\n * @deprecated see LivekitFocusSelection\n */\nexport const isLivekitFocusSelection = (object: any): object is LivekitFocusSelection =>\n object.type === \"livekit\" && \"focus_selection\" in object;\n\n/**\n * Identifies the MatrixRTC membership that a LiveKit request is made for (MSC4195).\n *\n * Note that this is *not* the `member` field of an `m.rtc.member` event verbatim: the homeserver knows\n * the user ID from the access token, and the device ID is only ever claimed, never verified.\n */\nexport interface LivekitRtcMember {\n /**\n * The ID of the member within the MatrixRTC session, i.e. the `member.id` of the `m.rtc.member` event.\n */\n id: string;\n /**\n * The device ID the member claims to be using, i.e. the `member.device_id` of the `m.rtc.member` event.\n */\n claimed_device_id?: string;\n}\n\n/**\n * The body of a request to the LiveKit `get_token` endpoint (MSC4195).\n *\n * Declared as a type alias rather than an interface so that it can be passed to the widget API\n * (MSC4533), which expects request data to be assignable to an index signature.\n */\nexport type LivekitGetTokenRequest = {\n /**\n * The WebSocket URL of the LiveKit SFU to obtain a token for.\n */\n url: string;\n /**\n * The room ID of the Matrix room the `m.rtc.member` event is in.\n */\n room_id: string;\n /**\n * The slot ID from the `m.rtc.member` event.\n */\n slot_id: string;\n /**\n * The MatrixRTC membership to obtain a token for.\n */\n member: LivekitRtcMember;\n /**\n * The server name of the `m.rtc.member` event's sender. If omitted, the homeserver uses its own\n * server name. This is what makes it possible to obtain a token for an SFU of a remote homeserver.\n */\n server_name?: string;\n};\n\n/**\n * The response of the LiveKit `get_token` endpoint (MSC4195).\n */\nexport interface LivekitGetTokenResponse {\n /**\n * The JWT to authenticate with when connecting to the SFU.\n */\n jwt: string;\n}\n\n/**\n * The body of a request to the LiveKit `delegate_delayed_leave` endpoint (MSC4195).\n *\n * Declared as a type alias rather than an interface so that it can be passed to the widget API\n * (MSC4533), which expects request data to be assignable to an index signature.\n */\nexport type LivekitDelegateDelayedLeaveRequest = {\n /**\n * The WebSocket URL of the LiveKit SFU that we are connected to.\n */\n url: string;\n /**\n * The room ID of the Matrix room the `m.rtc.member` event is in.\n */\n room_id: string;\n /**\n * The slot ID from the `m.rtc.member` event.\n */\n slot_id: string;\n /**\n * The MatrixRTC membership the delayed leave event belongs to.\n */\n member: LivekitRtcMember;\n /**\n * The delay ID of the delayed leave event to hand over to the homeserver.\n */\n delay_id: string;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;AACA;AACA;AACA;;AAMA;AACA;AACA;AACA,OAAO,MAAM,kBAAkB,GAAI,MAAe,IAAiC;EAC/E,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE,OAAO,KAAK;EAC/D,MAAM,SAAS,GAAG,MAAmB;EAErC,OAAO,SAAS,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,SAAS,CAAC,mBAAmB,KAAK,QAAQ;AAC5F,CAAC;;AAgBD;AACA;AACA;AACA;AACA;;AAgBA,OAAO,MAAM,0BAA0B,GAAI,MAAe,IAAyC;EAC/F,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE,OAAO,KAAK;EAC/D,MAAM,SAAS,GAAG,MAAmB;EAErC,IAAI,SAAS,CAAC,IAAI,KAAK,SAAS,EAAE,OAAO,KAAK;EAC9C,IAAI,EAAE,KAAK,IAAI,SAAS,IAAI,qBAAqB,IAAI,SAAS,CAAC,EAAE,OAAO,KAAK;EAC7E,IAAI,KAAK,IAAI,SAAS,IAAI,OAAO,SAAS,CAAC,GAAG,KAAK,QAAQ,EAAE,OAAO,KAAK;EACzE,IAAI,qBAAqB,IAAI,SAAS,IAAI,OAAO,SAAS,CAAC,mBAAmB,KAAK,QAAQ,EAAE,OAAO,KAAK;EACzG,OAAO,IAAI;AACf,CAAC;;AAED;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA,OAAO,MAAM,uBAAuB,GAAI,MAAW,IAC/C,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,iBAAiB,IAAI,MAAM;;AAE5D;AACA;AACA;AACA;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;;AAyBA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@ import { type Room } from "../models/room.ts";
|
|
|
3
3
|
import { type MatrixClient } from "../client.ts";
|
|
4
4
|
import { CallMembership } from "./CallMembership.ts";
|
|
5
5
|
import { type CallMembershipIdentityParts } from "./EncryptionManager.ts";
|
|
6
|
-
import type { Statistics, RTCNotificationType, Status, IRTCNotificationContent, RTCCallIntent, Transport, SlotDescription, RtcSlotEventContent, RtcSlotEncryptionContent } from "./types.ts";
|
|
6
|
+
import type { Statistics, RTCNotificationType, Status, IRTCNotificationContent, RTCCallIntent, RTCCallCapability, Transport, SlotDescription, RtcSlotEventContent, RtcSlotEncryptionContent } from "./types.ts";
|
|
7
7
|
import { MembershipManagerEvent, type MembershipManagerEventHandlerMap } from "./IMembershipManager.ts";
|
|
8
8
|
/**
|
|
9
9
|
* Events emitted by MatrixRTCSession
|
|
@@ -22,7 +22,7 @@ export declare enum MatrixRTCSessionEvent {
|
|
|
22
22
|
export type MatrixRTCSessionEventHandlerMap = {
|
|
23
23
|
[MatrixRTCSessionEvent.MembershipsChanged]: (oldMemberships: CallMembership[], newMemberships: CallMembership[]) => void;
|
|
24
24
|
[MatrixRTCSessionEvent.JoinStateChanged]: (isJoined: boolean) => void;
|
|
25
|
-
[MatrixRTCSessionEvent.EncryptionKeyChanged]: (key: Uint8Array<ArrayBuffer>, encryptionKeyIndex: number, membership: CallMembershipIdentityParts,
|
|
25
|
+
[MatrixRTCSessionEvent.EncryptionKeyChanged]: (key: Uint8Array<ArrayBuffer>, encryptionKeyIndex: number, membership: CallMembershipIdentityParts, backendIdentity: string) => void;
|
|
26
26
|
[MatrixRTCSessionEvent.MembershipManagerError]: (error: unknown) => void;
|
|
27
27
|
[MatrixRTCSessionEvent.DidSendCallNotification]: (notificationContentNew: {
|
|
28
28
|
event_id: string;
|
|
@@ -39,11 +39,15 @@ export interface SessionConfig {
|
|
|
39
39
|
* Determines the kind of call this will be.
|
|
40
40
|
*/
|
|
41
41
|
callIntent?: RTCCallIntent;
|
|
42
|
+
/**
|
|
43
|
+
* What kinds of media this device is capable of handling for the call.
|
|
44
|
+
*/
|
|
45
|
+
callCapabilities?: RTCCallCapability[];
|
|
42
46
|
/**
|
|
43
47
|
* Application-specific data to publish in our membership alongside the
|
|
44
|
-
* application `type
|
|
45
|
-
* an `m.rtc.member` event, or at the top level of a legacy
|
|
46
|
-
* one. Keys should be namespaced. Read back through
|
|
48
|
+
* application `type`, `m.call.intent` and `capabilities`: in the `application`
|
|
49
|
+
* object of an `m.rtc.member` event, or at the top level of a legacy
|
|
50
|
+
* `m.call.member` one. Keys should be namespaced. Read back through
|
|
47
51
|
* {@link CallMembership.applicationData}.
|
|
48
52
|
*/
|
|
49
53
|
applicationData?: Record<string, unknown>;
|
|
@@ -119,12 +123,6 @@ export interface EncryptionConfig {
|
|
|
119
123
|
* media keys for other participants become available.
|
|
120
124
|
*/
|
|
121
125
|
manageMediaKeys?: boolean;
|
|
122
|
-
/**
|
|
123
|
-
* The minimum time (in milliseconds) between each attempt to send encryption key(s).
|
|
124
|
-
* e.g. if this is set to 1000, then we will send at most one key event every second.
|
|
125
|
-
* @deprecated - Not used by the new encryption manager.
|
|
126
|
-
*/
|
|
127
|
-
updateEncryptionKeyThrottle?: number;
|
|
128
126
|
/**
|
|
129
127
|
* Sometimes it is necessary to rotate the encryption key after a membership update.
|
|
130
128
|
* For performance reasons we might not want to rotate the key immediately but allow future memberships to use the same key.
|
|
@@ -216,14 +214,6 @@ export declare class MatrixRTCSession extends TypedEventEmitter<MatrixRTCSession
|
|
|
216
214
|
* mirror of: EncryptionConfig.keyRotationParticipantLimit
|
|
217
215
|
*/
|
|
218
216
|
get isKeyRotationSuppressed(): boolean;
|
|
219
|
-
/**
|
|
220
|
-
* The callId (sessionId) of the call.
|
|
221
|
-
*
|
|
222
|
-
* It can be undefined since the callId is only known once the first membership joins.
|
|
223
|
-
* The callId is the property that, per definition, groups memberships into one call.
|
|
224
|
-
* @deprecated use `slotId` instead.
|
|
225
|
-
*/
|
|
226
|
-
get callId(): string | undefined;
|
|
227
217
|
/**
|
|
228
218
|
* The slotId of the call.
|
|
229
219
|
* `{application}#{appSpecificId}`
|
|
@@ -318,45 +308,22 @@ export declare class MatrixRTCSession extends TypedEventEmitter<MatrixRTCSession
|
|
|
318
308
|
* Announces this user and device as joined to the MatrixRTC session,
|
|
319
309
|
* and continues to update the membership event to keep it valid until
|
|
320
310
|
* leaveRoomSession() is called
|
|
321
|
-
* This will not subscribe to updates: remember to call subscribe() separately if
|
|
322
|
-
* desired.
|
|
323
311
|
* This method will return immediately and the session will be joined in the background.
|
|
324
312
|
* @param ownMembershipIdentity the identity of the user and device joining the session.
|
|
325
313
|
* This will be put into the content.member.
|
|
326
|
-
* @param
|
|
327
|
-
* If multiSfuFocus is set, this is only needed if this client wants to publish to multiple transports simultaneously.
|
|
328
|
-
* @param multiSfuFocus the active focus to use in the joined RTC membership event. Setting this implies the
|
|
329
|
-
* membership manager will operate in a multi-SFU connection mode. If `undefined`, an `oldest_membership`
|
|
330
|
-
* transport selection will be used instead.
|
|
314
|
+
* @param publishedTransports the list of transports on which the member is publishing.
|
|
331
315
|
* @param joinConfig - Additional configuration for the joined session.
|
|
332
316
|
*/
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
*
|
|
336
|
-
* @param fociPreferred
|
|
337
|
-
* @param multiSfuFocus
|
|
338
|
-
* @param joinConfig
|
|
339
|
-
* @deprecated use the joinRTCSession method instead
|
|
340
|
-
*/
|
|
341
|
-
joinRoomSession(fociPreferred: Transport[], multiSfuFocus?: Transport, joinConfig?: JoinSessionConfig): void;
|
|
317
|
+
join(ownMembershipIdentity: CallMembershipIdentityParts, publishedTransports: Transport[], joinConfig?: JoinSessionConfig): void;
|
|
342
318
|
/**
|
|
343
319
|
* Announces this user and device as having left the MatrixRTC session
|
|
344
320
|
* and stops scheduled updates.
|
|
345
|
-
* This will not unsubscribe from updates: remember to call unsubscribe() separately if
|
|
346
|
-
* desired.
|
|
347
321
|
* The membership update required to leave the session will retry if it fails.
|
|
348
322
|
* Without network connection the promise will never resolve.
|
|
349
323
|
* A timeout can be provided so that there is a guarantee for the promise to resolve.
|
|
350
324
|
* @returns Whether the membership update was attempted and did not time out.
|
|
351
325
|
*/
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* This returns the focus in use by the oldest membership.
|
|
355
|
-
* Do not use since this might be just the focus for the oldest membership. others might use a different focus.
|
|
356
|
-
* @deprecated use `member.getTransport(session.getOldestMembership())` instead for the specific member you want to get the focus for.
|
|
357
|
-
*/
|
|
358
|
-
getFocusInUse(): Transport | undefined;
|
|
359
|
-
getOldestMembership(): CallMembership | undefined;
|
|
326
|
+
leave(timeout?: number): Promise<boolean>;
|
|
360
327
|
/**
|
|
361
328
|
* Get the call intent for the current call, based on what members are advertising. If one or more
|
|
362
329
|
* members disagree on the current call intent, or nobody specifies one then `undefined` is returned.
|
|
@@ -404,12 +371,6 @@ export declare class MatrixRTCSession extends TypedEventEmitter<MatrixRTCSession
|
|
|
404
371
|
* Call this when a sticky event update has occured.
|
|
405
372
|
*/
|
|
406
373
|
private readonly onStickyEventUpdate;
|
|
407
|
-
/**
|
|
408
|
-
* Call this when something changed that may impacts the current MatrixRTC members in this session.
|
|
409
|
-
*
|
|
410
|
-
* @deprecated use {@link ensureRecalculateSessionMembers} instead.
|
|
411
|
-
*/
|
|
412
|
-
_onRTCSessionMemberUpdate: () => Promise<void>;
|
|
413
374
|
private recalculateSessionMembersPromise;
|
|
414
375
|
/**
|
|
415
376
|
* Ensures that membership is recalculated when the state of the session may have changed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MatrixRTCSession.d.ts","sourceRoot":"","sources":["../../src/matrixrtc/MatrixRTCSession.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,KAAK,YA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ypedEventEmitter {
|
|
|
92
92
|
return this.encryptionManager?.isKeyRotationSuppressed ?? false;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
/**
|
|
96
|
-
* The callId (sessionId) of the call.
|
|
97
|
-
*
|
|
98
|
-
* It can be undefined since the callId is only known once the first membership joins.
|
|
99
|
-
* The callId is the property that, per definition, groups memberships into one call.
|
|
100
|
-
* @deprecated use `slotId` instead.
|
|
101
|
-
*/
|
|
102
|
-
get callId() {
|
|
103
|
-
return this.slotDescription?.id;
|
|
104
|
-
}
|
|
105
95
|
/**
|
|
106
96
|
* The slotId of the call.
|
|
107
97
|
* `{application}#{appSpecificId}`
|
|
@@ -295,14 +285,6 @@ export class MatrixRTCSession extends TypedEventEmitter {
|
|
|
295
285
|
void this.ensureRecalculateSessionMembers();
|
|
296
286
|
}
|
|
297
287
|
});
|
|
298
|
-
/**
|
|
299
|
-
* Call this when something changed that may impacts the current MatrixRTC members in this session.
|
|
300
|
-
*
|
|
301
|
-
* @deprecated use {@link ensureRecalculateSessionMembers} instead.
|
|
302
|
-
*/
|
|
303
|
-
_defineProperty(this, "_onRTCSessionMemberUpdate", async () => {
|
|
304
|
-
await this.ensureRecalculateSessionMembers();
|
|
305
|
-
});
|
|
306
288
|
// Recalculations are chained onto this promise, so they never run in parallel.
|
|
307
289
|
_defineProperty(this, "recalculateSessionMembersPromise", Promise.resolve());
|
|
308
290
|
/**
|
|
@@ -363,12 +345,12 @@ export class MatrixRTCSession extends TypedEventEmitter {
|
|
|
363
345
|
this.initialMembershipCalculated = this.ensureRecalculateSessionMembers();
|
|
364
346
|
this.setExpiryTimer();
|
|
365
347
|
}
|
|
348
|
+
|
|
366
349
|
/*
|
|
367
350
|
* Returns true if we intend to be participating in the MatrixRTC session.
|
|
368
|
-
* This is determined by checking if the relativeExpiry has been set.
|
|
369
351
|
*/
|
|
370
352
|
isJoined() {
|
|
371
|
-
return this.membershipManager?.
|
|
353
|
+
return this.membershipManager?.isActivated() ?? false;
|
|
372
354
|
}
|
|
373
355
|
|
|
374
356
|
/**
|
|
@@ -388,19 +370,13 @@ export class MatrixRTCSession extends TypedEventEmitter {
|
|
|
388
370
|
* Announces this user and device as joined to the MatrixRTC session,
|
|
389
371
|
* and continues to update the membership event to keep it valid until
|
|
390
372
|
* leaveRoomSession() is called
|
|
391
|
-
* This will not subscribe to updates: remember to call subscribe() separately if
|
|
392
|
-
* desired.
|
|
393
373
|
* This method will return immediately and the session will be joined in the background.
|
|
394
374
|
* @param ownMembershipIdentity the identity of the user and device joining the session.
|
|
395
375
|
* This will be put into the content.member.
|
|
396
|
-
* @param
|
|
397
|
-
* If multiSfuFocus is set, this is only needed if this client wants to publish to multiple transports simultaneously.
|
|
398
|
-
* @param multiSfuFocus the active focus to use in the joined RTC membership event. Setting this implies the
|
|
399
|
-
* membership manager will operate in a multi-SFU connection mode. If `undefined`, an `oldest_membership`
|
|
400
|
-
* transport selection will be used instead.
|
|
376
|
+
* @param publishedTransports the list of transports on which the member is publishing.
|
|
401
377
|
* @param joinConfig - Additional configuration for the joined session.
|
|
402
378
|
*/
|
|
403
|
-
|
|
379
|
+
join(ownMembershipIdentity, publishedTransports, joinConfig) {
|
|
404
380
|
if (this.isJoined()) {
|
|
405
381
|
this.logger.info(`Already joined to session in room ${this.roomSubset.roomId}: ignoring join call`);
|
|
406
382
|
return;
|
|
@@ -411,52 +387,32 @@ export class MatrixRTCSession extends TypedEventEmitter {
|
|
|
411
387
|
// Create Encryption manager
|
|
412
388
|
const [room, client, statistics] = [this.roomSubset, this.client, this.statistics];
|
|
413
389
|
const transport = new ToDeviceKeyTransport(ownMembershipIdentity, room.roomId, client, statistics);
|
|
414
|
-
this.encryptionManager = new RTCEncryptionManager(ownMembershipIdentity, () => this.memberships, transport, (keyBin, encryptionKeyIndex, membership,
|
|
415
|
-
this.emit(MatrixRTCSessionEvent.EncryptionKeyChanged, keyBin, encryptionKeyIndex, membership,
|
|
390
|
+
this.encryptionManager = new RTCEncryptionManager(ownMembershipIdentity, () => this.memberships, transport, (keyBin, encryptionKeyIndex, membership, backendIdentity) => {
|
|
391
|
+
this.emit(MatrixRTCSessionEvent.EncryptionKeyChanged, keyBin, encryptionKeyIndex, membership, backendIdentity);
|
|
416
392
|
}, this.logger);
|
|
417
393
|
}
|
|
418
394
|
this.joinConfig = joinConfig;
|
|
419
395
|
this.pendingNotificationToSend = this.joinConfig?.notificationType;
|
|
420
396
|
|
|
421
397
|
// Join!
|
|
422
|
-
this.membershipManager.join(
|
|
398
|
+
this.membershipManager.join(publishedTransports, e => {
|
|
423
399
|
this.logger.error("MembershipManager encountered an unrecoverable error: ", e);
|
|
424
400
|
this.emit(MatrixRTCSessionEvent.MembershipManagerError, e);
|
|
425
401
|
this.emit(MatrixRTCSessionEvent.JoinStateChanged, this.isJoined());
|
|
426
402
|
});
|
|
427
|
-
this.encryptionManager.join(joinConfig);
|
|
403
|
+
this.encryptionManager.join(joinConfig, publishedTransports);
|
|
428
404
|
this.emit(MatrixRTCSessionEvent.JoinStateChanged, true);
|
|
429
405
|
}
|
|
430
406
|
|
|
431
|
-
/**
|
|
432
|
-
*
|
|
433
|
-
* @param fociPreferred
|
|
434
|
-
* @param multiSfuFocus
|
|
435
|
-
* @param joinConfig
|
|
436
|
-
* @deprecated use the joinRTCSession method instead
|
|
437
|
-
*/
|
|
438
|
-
joinRoomSession(fociPreferred, multiSfuFocus, joinConfig) {
|
|
439
|
-
const [userId, deviceId] = [this.client.getUserId(), this.client.getDeviceId()];
|
|
440
|
-
// TODO this wants to become a UUID
|
|
441
|
-
const memberId = `${userId}:${deviceId}`;
|
|
442
|
-
this.joinRTCSession({
|
|
443
|
-
userId,
|
|
444
|
-
deviceId,
|
|
445
|
-
memberId
|
|
446
|
-
}, fociPreferred, multiSfuFocus, joinConfig);
|
|
447
|
-
}
|
|
448
|
-
|
|
449
407
|
/**
|
|
450
408
|
* Announces this user and device as having left the MatrixRTC session
|
|
451
409
|
* and stops scheduled updates.
|
|
452
|
-
* This will not unsubscribe from updates: remember to call unsubscribe() separately if
|
|
453
|
-
* desired.
|
|
454
410
|
* The membership update required to leave the session will retry if it fails.
|
|
455
411
|
* Without network connection the promise will never resolve.
|
|
456
412
|
* A timeout can be provided so that there is a guarantee for the promise to resolve.
|
|
457
413
|
* @returns Whether the membership update was attempted and did not time out.
|
|
458
414
|
*/
|
|
459
|
-
async
|
|
415
|
+
async leave(timeout) {
|
|
460
416
|
if (!this.isJoined()) {
|
|
461
417
|
this.logger.info(`Not joined to session in room ${this.roomSubset.roomId}: ignoring leave call`);
|
|
462
418
|
return false;
|
|
@@ -467,18 +423,6 @@ export class MatrixRTCSession extends TypedEventEmitter {
|
|
|
467
423
|
this.emit(MatrixRTCSessionEvent.JoinStateChanged, false);
|
|
468
424
|
return await leavePromise;
|
|
469
425
|
}
|
|
470
|
-
/**
|
|
471
|
-
* This returns the focus in use by the oldest membership.
|
|
472
|
-
* Do not use since this might be just the focus for the oldest membership. others might use a different focus.
|
|
473
|
-
* @deprecated use `member.getTransport(session.getOldestMembership())` instead for the specific member you want to get the focus for.
|
|
474
|
-
*/
|
|
475
|
-
getFocusInUse() {
|
|
476
|
-
const oldestMembership = this.getOldestMembership();
|
|
477
|
-
return oldestMembership?.getTransport(oldestMembership);
|
|
478
|
-
}
|
|
479
|
-
getOldestMembership() {
|
|
480
|
-
return this.memberships[0];
|
|
481
|
-
}
|
|
482
426
|
|
|
483
427
|
/**
|
|
484
428
|
* Get the call intent for the current call, based on what members are advertising. If one or more
|
|
@@ -524,7 +468,7 @@ export class MatrixRTCSession extends TypedEventEmitter {
|
|
|
524
468
|
reemitEncryptionKeys() {
|
|
525
469
|
this.encryptionManager?.getEncryptionKeys().forEach((keyRing, key) => {
|
|
526
470
|
keyRing.forEach(keyInfo => {
|
|
527
|
-
this.emit(MatrixRTCSessionEvent.EncryptionKeyChanged, keyInfo.key, keyInfo.keyIndex, keyInfo.membership, keyInfo.
|
|
471
|
+
this.emit(MatrixRTCSessionEvent.EncryptionKeyChanged, keyInfo.key, keyInfo.keyIndex, keyInfo.membership, keyInfo.backendIdentity);
|
|
528
472
|
});
|
|
529
473
|
});
|
|
530
474
|
}
|