matrix-js-sdk 42.4.0 → 43.0.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/CHANGELOG.md +23 -0
- package/lib/@types/PushRules.d.ts +3 -1
- package/lib/@types/PushRules.d.ts.map +1 -1
- package/lib/@types/PushRules.js +2 -0
- package/lib/@types/PushRules.js.map +1 -1
- package/lib/@types/event.d.ts +1 -0
- package/lib/@types/event.d.ts.map +1 -1
- package/lib/@types/event.js.map +1 -1
- package/lib/@types/matrix-sdk-crypto-wasm.d.js.map +1 -1
- package/lib/client.d.ts +88 -37
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +72 -47
- package/lib/client.js.map +1 -1
- package/lib/crypto-api/index.d.ts +3 -3
- package/lib/crypto-api/index.d.ts.map +1 -1
- package/lib/crypto-api/index.js.map +1 -1
- package/lib/embedded.d.ts +17 -1
- package/lib/embedded.d.ts.map +1 -1
- package/lib/embedded.js +46 -1
- package/lib/embedded.js.map +1 -1
- package/lib/errors.d.ts +1 -1
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +2 -2
- package/lib/errors.js.map +1 -1
- package/lib/http-api/fetch.d.ts +7 -1
- package/lib/http-api/fetch.d.ts.map +1 -1
- package/lib/http-api/fetch.js +14 -5
- package/lib/http-api/fetch.js.map +1 -1
- package/lib/http-api/interface.d.ts +34 -8
- package/lib/http-api/interface.d.ts.map +1 -1
- package/lib/http-api/interface.js +10 -3
- package/lib/http-api/interface.js.map +1 -1
- package/lib/http-api/refresh.d.ts +30 -11
- package/lib/http-api/refresh.d.ts.map +1 -1
- package/lib/http-api/refresh.js +72 -5
- package/lib/http-api/refresh.js.map +1 -1
- package/lib/matrix.d.ts +1 -1
- package/lib/matrix.d.ts.map +1 -1
- package/lib/matrix.js.map +1 -1
- package/lib/matrixrtc/CallMembership.d.ts.map +1 -1
- package/lib/matrixrtc/CallMembership.js +20 -6
- package/lib/matrixrtc/CallMembership.js.map +1 -1
- package/lib/matrixrtc/IMembershipManager.d.ts +5 -0
- package/lib/matrixrtc/IMembershipManager.d.ts.map +1 -1
- package/lib/matrixrtc/IMembershipManager.js.map +1 -1
- package/lib/matrixrtc/MatrixRTCSession.d.ts +27 -1
- package/lib/matrixrtc/MatrixRTCSession.d.ts.map +1 -1
- package/lib/matrixrtc/MatrixRTCSession.js +58 -36
- package/lib/matrixrtc/MatrixRTCSession.js.map +1 -1
- package/lib/matrixrtc/MatrixRTCSessionManager.js +1 -1
- package/lib/matrixrtc/MatrixRTCSessionManager.js.map +1 -1
- package/lib/matrixrtc/MembershipManager.d.ts +76 -0
- package/lib/matrixrtc/MembershipManager.d.ts.map +1 -1
- package/lib/matrixrtc/MembershipManager.js +264 -47
- package/lib/matrixrtc/MembershipManager.js.map +1 -1
- package/lib/matrixrtc/index.d.ts +1 -1
- package/lib/matrixrtc/index.d.ts.map +1 -1
- package/lib/matrixrtc/index.js +1 -1
- package/lib/matrixrtc/index.js.map +1 -1
- package/lib/matrixrtc/membershipData/common.d.ts +8 -0
- package/lib/matrixrtc/membershipData/common.d.ts.map +1 -1
- package/lib/matrixrtc/membershipData/common.js +10 -0
- package/lib/matrixrtc/membershipData/common.js.map +1 -1
- package/lib/matrixrtc/membershipData/index.d.ts +1 -1
- package/lib/matrixrtc/membershipData/index.d.ts.map +1 -1
- package/lib/matrixrtc/membershipData/index.js +1 -1
- package/lib/matrixrtc/membershipData/index.js.map +1 -1
- package/lib/matrixrtc/types.d.ts +104 -11
- package/lib/matrixrtc/types.d.ts.map +1 -1
- package/lib/matrixrtc/types.js +263 -19
- package/lib/matrixrtc/types.js.map +1 -1
- package/lib/matrixrtc/utils.d.ts +22 -1
- package/lib/matrixrtc/utils.d.ts.map +1 -1
- package/lib/matrixrtc/utils.js +38 -0
- package/lib/matrixrtc/utils.js.map +1 -1
- package/lib/models/room-sticky-events.d.ts +7 -0
- package/lib/models/room-sticky-events.d.ts.map +1 -1
- package/lib/models/room-sticky-events.js +27 -0
- package/lib/models/room-sticky-events.js.map +1 -1
- package/lib/models/thread.d.ts.map +1 -1
- package/lib/models/thread.js +8 -0
- package/lib/models/thread.js.map +1 -1
- package/lib/oauth/authorize.js +1 -1
- package/lib/oauth/authorize.js.map +1 -1
- package/lib/oauth/index.d.ts +3 -5
- package/lib/oauth/index.d.ts.map +1 -1
- package/lib/oauth/index.js +7 -7
- package/lib/oauth/index.js.map +1 -1
- package/lib/oauth/tokenRefresher.d.ts +10 -4
- package/lib/oauth/tokenRefresher.d.ts.map +1 -1
- package/lib/oauth/tokenRefresher.js +34 -24
- package/lib/oauth/tokenRefresher.js.map +1 -1
- package/lib/receipt-accumulator.d.ts +10 -11
- package/lib/receipt-accumulator.d.ts.map +1 -1
- package/lib/receipt-accumulator.js +26 -25
- package/lib/receipt-accumulator.js.map +1 -1
- package/lib/room-summary-api.d.ts +71 -0
- package/lib/room-summary-api.d.ts.map +1 -0
- package/lib/room-summary-api.js +82 -0
- package/lib/room-summary-api.js.map +1 -0
- package/lib/rust-crypto/backup.d.ts +7 -0
- package/lib/rust-crypto/backup.d.ts.map +1 -1
- package/lib/rust-crypto/backup.js +41 -25
- package/lib/rust-crypto/backup.js.map +1 -1
- package/lib/sync.d.ts.map +1 -1
- package/lib/sync.js +6 -1
- package/lib/sync.js.map +1 -1
- package/package.json +6 -6
- package/src/@types/PushRules.ts +2 -0
- package/src/@types/event.ts +1 -1
- package/src/@types/matrix-sdk-crypto-wasm.d.ts +15 -12
- package/src/client.ts +105 -62
- package/src/crypto-api/index.ts +3 -3
- package/src/embedded.ts +61 -2
- package/src/errors.ts +2 -1
- package/src/http-api/fetch.ts +14 -5
- package/src/http-api/interface.ts +36 -8
- package/src/http-api/refresh.ts +101 -17
- package/src/matrix.ts +1 -1
- package/src/matrixrtc/CallMembership.ts +22 -4
- package/src/matrixrtc/IMembershipManager.ts +6 -0
- package/src/matrixrtc/MatrixRTCSession.ts +72 -49
- package/src/matrixrtc/MatrixRTCSessionManager.ts +1 -1
- package/src/matrixrtc/MembershipManager.ts +284 -61
- package/src/matrixrtc/index.ts +7 -1
- package/src/matrixrtc/membershipData/common.ts +12 -0
- package/src/matrixrtc/membershipData/index.ts +1 -1
- package/src/matrixrtc/types.ts +351 -23
- package/src/matrixrtc/utils.ts +54 -1
- package/src/models/room-sticky-events.ts +26 -1
- package/src/models/thread.ts +9 -0
- package/src/oauth/authorize.ts +1 -1
- package/src/oauth/index.ts +7 -8
- package/src/oauth/tokenRefresher.ts +15 -5
- package/src/receipt-accumulator.ts +30 -26
- package/src/room-summary-api.ts +114 -0
- package/src/rust-crypto/backup.ts +46 -33
- package/src/sync.ts +9 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CallMembership.js","names":[],"sources":["../../src/matrixrtc/CallMembership.ts"],"sourcesContent":["/*\nCopyright 2023-2026 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 { deepCompare } from \"../utils.ts\";\nimport { type RTCCallIntent, type Transport, type SlotDescription } from \"./types.ts\";\nimport { type MatrixEvent } from \"../models/event.ts\";\nimport { type Logger, logger } from \"../logger.ts\";\nimport { computeSlotId, slotIdToDescription } from \"./utils.ts\";\nimport {\n checkRtcMembershipData,\n computeRtcIdentityRaw,\n type RtcMembershipData,\n checkSessionsMembershipData,\n type SessionMembershipData,\n MatrixRTCMembershipParseError,\n} from \"./membershipData/index.ts\";\nimport { EventType } from \"../@types/event.ts\";\n\n/**\n * The default duration in milliseconds that a membership is considered valid for.\n * Ordinarily the client responsible for the session will update the membership before it expires.\n * We use this duration as the fallback case where stale sessions are present for some reason.\n */\nexport const DEFAULT_EXPIRE_DURATION = 1000 * 60 * 60 * 4;\n\n/**\n * Describes the source event type that provided the membership data.\n */\nenum MembershipKind {\n /**\n * The modern MSC4143 format event.\n */\n RTC = \"rtc\",\n /**\n * The legacy call event type.\n */\n Session = \"session\",\n}\n\ntype MembershipData =\n | { kind: MembershipKind.RTC; data: RtcMembershipData }\n | { kind: MembershipKind.Session; data: SessionMembershipData };\n\ntype LimitedEvent = Pick<MatrixEvent, \"getId\" | \"getSender\" | \"getTs\" | \"getType\" | \"getContent\">;\n// TODO: Rename to RtcMembership once we removed the legacy SessionMembership is removed, to avoid confusion.\nexport class CallMembership {\n /**\n * Parse the membershipdata from a call membership event.\n * @param matrixEvent The Matrix event to read.\n * @returns MembershipData in either MembershipKind.RTC or MembershipKind.Session format.\n * @throws If the content is neither format.\n */\n public static membershipDataFromMatrixEvent(matrixEvent: LimitedEvent): MembershipData {\n const sender = matrixEvent.getSender();\n const evType = matrixEvent.getType();\n const data = matrixEvent.getContent();\n if (sender === undefined) throw new Error(\"matrixEvent is missing sender field\");\n try {\n // Event types are strictly checked here.\n if (evType === EventType.RTCMembership && checkRtcMembershipData(data, sender)) {\n return { kind: MembershipKind.RTC, data };\n } else if (evType === EventType.GroupCallMemberPrefix && checkSessionsMembershipData(data)) {\n return { kind: MembershipKind.Session, data };\n } else {\n throw Error(`'${evType} is not a known call membership type`);\n }\n } catch (ex) {\n if (ex instanceof MatrixRTCMembershipParseError) {\n logger.debug(\"CallMembership.MatrixRTCMembershipParseError provided invalid data\", data);\n }\n throw ex;\n }\n }\n\n /**\n * Parse the contents of a MatrixEvent and create a CallMembership instance.\n * @param matrixEvent The Matrix event to read.\n */\n public static async parseFromEvent(matrixEvent: LimitedEvent): Promise<CallMembership> {\n const membershipData: MembershipData = this.membershipDataFromMatrixEvent(matrixEvent);\n const rtcBackendIdentity =\n membershipData.kind === MembershipKind.RTC\n ? await computeRtcIdentityRaw(\n membershipData.data.member.user_id,\n membershipData.data.member.device_id,\n membershipData.data.member.id,\n )\n : `${matrixEvent.getSender()}:${membershipData.data.device_id}`;\n return new CallMembership(matrixEvent, membershipData, rtcBackendIdentity);\n }\n\n public static equal(a?: CallMembership, b?: CallMembership): boolean {\n return deepCompare(a?.membershipData, b?.membershipData);\n }\n\n private logger: Logger;\n\n /** The parsed data from the Matrix event.\n * To access checked eventId and sender from the matrixEvent.\n * Class construction will fail if these values cannot get obtained. */\n private readonly matrixEventData: { eventId: string; sender: string };\n\n /**\n * Use `parseFromEvent`.\n * Constructor should only be used by tests.\n * @private\n * @param matrixEvent\n * @param membershipData\n * @param rtcBackendIdentity\n */\n public constructor(\n /** The Matrix event that this membership is based on */\n private readonly matrixEvent: LimitedEvent,\n private readonly membershipData: MembershipData,\n public readonly rtcBackendIdentity: string,\n ) {\n const eventId = matrixEvent.getId();\n const sender = matrixEvent.getSender();\n\n if (eventId === undefined) throw new Error(\"parentEvent is missing eventId field\");\n if (sender === undefined) throw new Error(\"parentEvent is missing sender field\");\n\n this.logger = logger.getChild(`[CallMembership ${sender}:${this.deviceId}]`);\n this.matrixEventData = { eventId, sender };\n }\n\n /** @deprecated use userId instead */\n public get sender(): string {\n return this.userId;\n }\n\n public get userId(): string {\n const { kind, data } = this.membershipData;\n switch (kind) {\n case MembershipKind.RTC:\n return data.member.user_id;\n case MembershipKind.Session:\n default:\n return this.matrixEventData.sender;\n }\n }\n\n public get eventId(): string {\n return this.matrixEventData.eventId;\n }\n\n /**\n * The ID of the MatrixRTC slot that this membership belongs to (format `{application}#{id}`).\n * This is computed in case SessionMembershipData is used.\n */\n public get slotId(): string {\n const { kind, data } = this.membershipData;\n if (data.application === \"m.call\") {\n switch (kind) {\n case MembershipKind.RTC:\n return data.slot_id;\n case MembershipKind.Session:\n default: {\n const [application, id] = [data.application, data.call_id];\n\n // INFO_SLOT_ID_LEGACY_CASE (search for all occurances of this INFO to get the full picture)\n // The spec got changed to use `\"ROOM\"` instead of `\"\"` empyt string for the implicit default call.\n // State events still are sent with `\"\"` however. To find other events that should end up in the same call,\n // we use the slotId.\n // Since the CallMembership is the public representation of a rtc.member event, we just pretend it is a\n // \"ROOM\" slotId/call_id.\n // This makes all the remote members work with just this simple trick.\n //\n // We of course now need to be careful when sending legacy events (state events)\n // They get a slotDescription containing \"ROOM\" since this is what we use starting at the time this comment\n // is commited.\n //\n // See the Other INFO_SLOT_ID_LEGACY_CASE comments to see where we revert back to \"\" just before sending the event.\n let compatibilityAdaptedId: string;\n if (id === \"\") {\n compatibilityAdaptedId = \"ROOM\";\n this.logger?.info(\"use slotId compat hack emptyString -> ROOM\");\n } else {\n compatibilityAdaptedId = id;\n }\n return computeSlotId({\n application,\n id: compatibilityAdaptedId,\n });\n }\n }\n }\n\n this.logger?.info(\"NOT using slotId compat hack emptyString -> ROOM\");\n // This is what the function should look like for any other application that did not\n // go through a `\"\"`=> `\"ROOM\"` rename\n switch (kind) {\n case MembershipKind.RTC:\n return data.slot_id;\n case MembershipKind.Session:\n default:\n return computeSlotId({ application: data.application, id: data.call_id });\n }\n }\n\n public get deviceId(): string {\n const { kind, data } = this.membershipData;\n switch (kind) {\n case MembershipKind.RTC:\n return data.member.device_id;\n case MembershipKind.Session:\n default:\n return data.device_id;\n }\n }\n\n public get callIntent(): RTCCallIntent | undefined {\n const intent = this.applicationData[\"m.call.intent\"];\n if (typeof intent === \"string\") {\n return intent;\n }\n this.logger.warn(\"RTC membership has invalid m.call.intent\");\n return undefined;\n }\n\n /**\n * Parsed `slot_id` (format `{application}#{id}`) into its components (application and id).\n */\n public get slotDescription(): SlotDescription {\n const { kind, data } = this.membershipData;\n if (kind === MembershipKind.RTC) {\n const id = data.slot_id.slice(`${data.application.type}#`.length);\n return { application: data.application.type, id };\n }\n return slotIdToDescription(this.slotId);\n }\n\n /**\n * The application `type`.\n * @deprecated Use @see applicationData\n */\n public get application(): string {\n return this.applicationData.type;\n }\n\n /**\n * Information about the application being used for the RTC session.\n * May contain extra keys specific to the application.\n */\n public get applicationData(): { type: string; [key: string]: unknown } {\n const { kind, data } = this.membershipData;\n switch (kind) {\n case MembershipKind.RTC:\n return data.application;\n case MembershipKind.Session:\n default:\n // SessionData does not have application data as such. We return specific\n // properties in use by other getters in this class, for compatibility.\n return { \"type\": data.application, \"m.call.intent\": data[\"m.call.intent\"] };\n }\n }\n\n /** @deprecated scope is not used and will be removed in future versions. replaced by application specific types.*/\n public get scope(): SessionMembershipData[\"scope\"] | undefined {\n const { kind, data } = this.membershipData;\n switch (kind) {\n case MembershipKind.RTC:\n return undefined;\n case MembershipKind.Session:\n default:\n return data.scope;\n }\n }\n\n /**\n * This computes the membership ID for the membership.\n * For the sticky event based rtcSessionData this is trivial it is `member.id`.\n * This is not supposed to be used to identity on an rtc backend. This is just a nouance for\n * a generated (sha256) anonymised identity. Only send `rtcBackendIdentity` to any rtc backend service.\n *\n * For the legacy sessionMemberEvents it is a bit more complex. Here we sometimes do not have this data\n * in the event content and we expected the SFU and the client to use `${this.matrixEventData.sender}:${data.device_id}`.\n *\n * So if there is no membershipID we use the hard coded jwt id default (`${this.matrixEventData.sender}:${data.device_id}`)\n * value (used until version 0.16.0)\n *\n * It is also possible for a session event to set a custom membershipID. in that case this will be used.\n */\n public get memberId(): string {\n // the createdTs behaves equivalent to the membershipID.\n // we only need the field for the legacy member events where we needed to update them\n // synapse ignores sending state events if they have the same content.\n const { kind, data } = this.membershipData;\n switch (kind) {\n case \"rtc\":\n return data.member.id;\n case \"session\":\n return (\n // best case we have a client already publishing the right custom membershipId\n data.membershipID ??\n // alternativly we use the hard coded jwt id defuatl value (used until version 0.16.0)\n `${this.matrixEventData.sender}:${data.device_id}`\n );\n default:\n throw Error(\"Not possible to get memberID without knowing the membership event kind\");\n }\n }\n\n /**\n * @deprecated renamed to `memberId`\n */\n public get membershipID(): string {\n return this.memberId;\n }\n\n public createdTs(): number {\n const { kind, data } = this.membershipData;\n switch (kind) {\n case MembershipKind.RTC:\n // TODO we need to read the referenced (relation) event if available to get the real created_ts\n return this.matrixEvent.getTs();\n case MembershipKind.Session:\n default:\n return data.created_ts ?? this.matrixEvent.getTs();\n }\n }\n\n /**\n * Gets the absolute expiry timestamp of the membership.\n * @returns The absolute expiry time of the membership as a unix timestamp in milliseconds or undefined if not applicable\n */\n public getAbsoluteExpiry(): number | undefined {\n const { kind, data } = this.membershipData;\n switch (kind) {\n case MembershipKind.RTC:\n return undefined;\n case MembershipKind.Session:\n default:\n // TODO: calculate this from the MatrixRTCSession join configuration directly\n return this.createdTs() + (data.expires ?? DEFAULT_EXPIRE_DURATION);\n }\n }\n\n /**\n * @returns The number of milliseconds until the membership expires or undefined if applicable\n * @deprecated Not used by RTC events.\n */\n public getMsUntilExpiry(): number | undefined {\n const { kind } = this.membershipData;\n if (kind === MembershipKind.Session) {\n const absExpiry = this.getAbsoluteExpiry();\n if (absExpiry) {\n // Assume that local clock is sufficiently in sync with other clocks in the distributed system.\n // We used to try and adjust for the local clock being skewed, but there are cases where this is not accurate.\n // The current implementation allows for the local clock to be -infinity to +MatrixRTCSession.MEMBERSHIP_EXPIRY_TIME/2\n return absExpiry - Date.now();\n }\n }\n return undefined;\n }\n\n /**\n * @returns true if the membership has expired, otherwise false\n */\n public isExpired(): boolean {\n const { kind } = this.membershipData;\n switch (kind) {\n case MembershipKind.RTC:\n return false;\n case MembershipKind.Session:\n default:\n return this.getMsUntilExpiry()! <= 0;\n }\n }\n\n /**\n * ## RTC Membership\n * Gets the primary transport to use for this RTC membership (m.rtc.member).\n * This will return the primary transport that is used by this call membership to publish their media.\n * Directly relates to the `transports.published` field.\n *\n * ## Legacy session membership\n * In case of a legacy session membership (m.call.member) this will return the selected transport where\n * media is published. How this selection happens depends on the `focus_active` field of the session membership.\n * If the `focus_selection` is `oldest_membership` this will return the transport of the oldest membership\n * in the room (based on the `created_ts` field of the session membership).\n * If the `focus_selection` is `multi_sfu` it will return the first transport of the `foci_preferred` list.\n * (`multi_sfu` is equivalent to how `m.rtc.member` `transports.published` work).\n * @param oldestMembership For backwards compatibility with session membership (legacy). Unused in case of RTC membership.\n * Always required to make the consumer not care if it deals with RTC or session memberships.\n * @returns The transport this membership uses to publish media or undefined if no transport is available.\n */\n public getTransport(oldestMembership: CallMembership): Transport | undefined {\n const { kind, data } = this.membershipData;\n switch (kind) {\n case MembershipKind.RTC:\n return data.transports.published[0];\n case MembershipKind.Session:\n switch (data.focus_active.focus_selection) {\n case \"oldest_membership\":\n if (CallMembership.equal(this, oldestMembership)) return data.foci_preferred[0];\n if (oldestMembership !== undefined) return oldestMembership.getTransport(oldestMembership);\n break;\n case \"multi_sfu\":\n return data.foci_preferred[0];\n default:\n // `focus_selection` not understood.\n return undefined;\n }\n break;\n default:\n return undefined;\n }\n }\n\n /**\n * The value of the `transports.published` field for RTC memberships (m.rtc.member).\n * Or the value of the `foci_preferred` field for legacy session memberships (m.call.member).\n */\n public get transports(): Transport[] {\n const { kind, data } = this.membershipData;\n switch (kind) {\n case MembershipKind.RTC:\n return data.transports.published;\n case MembershipKind.Session:\n default:\n return data.foci_preferred;\n }\n }\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAS,WAAW,QAAQ,aAAa;AAGzC,SAAsB,MAAM,QAAQ,cAAc;AAClD,SAAS,aAAa,EAAE,mBAAmB,QAAQ,YAAY;AAC/D,SACI,sBAAsB,EACtB,qBAAqB,EAErB,2BAA2B,EAE3B,6BAA6B,QAC1B,2BAA2B;AAClC,SAAS,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM,uBAAuB,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;;AAEzD;AACA;AACA;AAFA,IAGK,cAAc,0BAAd,cAAc;EACf;AACJ;AACA;EAHK,cAAc;EAKf;AACJ;AACA;EAPK,cAAc;EAAA,OAAd,cAAc;AAAA,EAAd,cAAc;AAgBnB;AACA,OAAO,MAAM,cAAc,CAAC;EACxB;AACJ;AACA;AACA;AACA;AAC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c,CAAC,KAAK,CAAC,IAAI,EAAE,gBAAgB,CAAC,EAAE,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;YAC/E,IAAI,gBAAgB,KAAK,SAAS,EAAE,OAAO,gBAAgB,CAAC,YAAY,CAAC,gBAAgB,CAAC;YAC1F;UACJ,KAAK,WAAW;YACZ,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;UACjC;YACI;YACA,OAAO,SAAS;QACxB;QACA;MACJ;QACI,OAAO,SAAS;IACxB;EACJ;;EAEA;AACJ;AACA;AACA;EACI,IAAW,UAAU,GAAgB;IACjC,MAAM;MAAE,IAAI;MAAE;IAAK,CAAC,GAAG,IAAI,CAAC,cAAc;IAC1C,QAAQ,IAAI;MACR,KAAK,cAAc,CAAC,GAAG;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS;MACpC,KAAK,cAAc,CAAC,OAAO;MAC3B;QACI,OAAO,IAAI,CAAC,cAAc;IAClC;EACJ;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"CallMembership.js","names":[],"sources":["../../src/matrixrtc/CallMembership.ts"],"sourcesContent":["/*\nCopyright 2023-2026 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 { deepCompare } from \"../utils.ts\";\nimport { type RTCCallIntent, type Transport, type SlotDescription } from \"./types.ts\";\nimport { type MatrixEvent } from \"../models/event.ts\";\nimport { type Logger, logger } from \"../logger.ts\";\nimport { computeSlotId, slotIdToDescription } from \"./utils.ts\";\nimport {\n checkRtcMembershipData,\n computeRtcIdentityRaw,\n type RtcMembershipData,\n checkSessionsMembershipData,\n type SessionMembershipData,\n MatrixRTCMembershipParseError,\n} from \"./membershipData/index.ts\";\nimport { EventType } from \"../@types/event.ts\";\n\n/**\n * The default duration in milliseconds that a membership is considered valid for.\n * Ordinarily the client responsible for the session will update the membership before it expires.\n * We use this duration as the fallback case where stale sessions are present for some reason.\n */\nexport const DEFAULT_EXPIRE_DURATION = 1000 * 60 * 60 * 4;\n\n/** The fields of a legacy session membership that belong to the session, not the application */\nconst sessionFields: (keyof SessionMembershipData)[] = [\n \"application\",\n \"call_id\",\n \"device_id\",\n \"focus_active\",\n \"foci_preferred\",\n \"created_ts\",\n \"scope\",\n \"expires\",\n \"m.call.intent\",\n \"membershipID\",\n];\n\n/**\n * Describes the source event type that provided the membership data.\n */\nenum MembershipKind {\n /**\n * The modern MSC4143 format event.\n */\n RTC = \"rtc\",\n /**\n * The legacy call event type.\n */\n Session = \"session\",\n}\n\ntype MembershipData =\n | { kind: MembershipKind.RTC; data: RtcMembershipData }\n | { kind: MembershipKind.Session; data: SessionMembershipData };\n\ntype LimitedEvent = Pick<MatrixEvent, \"getId\" | \"getSender\" | \"getTs\" | \"getType\" | \"getContent\">;\n// TODO: Rename to RtcMembership once we removed the legacy SessionMembership is removed, to avoid confusion.\nexport class CallMembership {\n /**\n * Parse the membershipdata from a call membership event.\n * @param matrixEvent The Matrix event to read.\n * @returns MembershipData in either MembershipKind.RTC or MembershipKind.Session format.\n * @throws If the content is neither format.\n */\n public static membershipDataFromMatrixEvent(matrixEvent: LimitedEvent): MembershipData {\n const sender = matrixEvent.getSender();\n const evType = matrixEvent.getType();\n const data = matrixEvent.getContent();\n if (sender === undefined) throw new Error(\"matrixEvent is missing sender field\");\n try {\n // Event types are strictly checked here.\n if (evType === EventType.RTCMembership && checkRtcMembershipData(data, sender)) {\n return { kind: MembershipKind.RTC, data };\n } else if (evType === EventType.GroupCallMemberPrefix && checkSessionsMembershipData(data)) {\n return { kind: MembershipKind.Session, data };\n } else {\n throw Error(`'${evType} is not a known call membership type`);\n }\n } catch (ex) {\n if (ex instanceof MatrixRTCMembershipParseError) {\n logger.debug(\"CallMembership.MatrixRTCMembershipParseError provided invalid data\", data);\n }\n throw ex;\n }\n }\n\n /**\n * Parse the contents of a MatrixEvent and create a CallMembership instance.\n * @param matrixEvent The Matrix event to read.\n */\n public static async parseFromEvent(matrixEvent: LimitedEvent): Promise<CallMembership> {\n const membershipData: MembershipData = this.membershipDataFromMatrixEvent(matrixEvent);\n const rtcBackendIdentity =\n membershipData.kind === MembershipKind.RTC\n ? await computeRtcIdentityRaw(\n membershipData.data.member.user_id,\n membershipData.data.member.device_id,\n membershipData.data.member.id,\n )\n : `${matrixEvent.getSender()}:${membershipData.data.device_id}`;\n return new CallMembership(matrixEvent, membershipData, rtcBackendIdentity);\n }\n\n public static equal(a?: CallMembership, b?: CallMembership): boolean {\n return deepCompare(a?.membershipData, b?.membershipData);\n }\n\n private logger: Logger;\n\n /** The parsed data from the Matrix event.\n * To access checked eventId and sender from the matrixEvent.\n * Class construction will fail if these values cannot get obtained. */\n private readonly matrixEventData: { eventId: string; sender: string };\n\n /**\n * Use `parseFromEvent`.\n * Constructor should only be used by tests.\n * @private\n * @param matrixEvent\n * @param membershipData\n * @param rtcBackendIdentity\n */\n public constructor(\n /** The Matrix event that this membership is based on */\n private readonly matrixEvent: LimitedEvent,\n private readonly membershipData: MembershipData,\n public readonly rtcBackendIdentity: string,\n ) {\n const eventId = matrixEvent.getId();\n const sender = matrixEvent.getSender();\n\n if (eventId === undefined) throw new Error(\"parentEvent is missing eventId field\");\n if (sender === undefined) throw new Error(\"parentEvent is missing sender field\");\n\n this.logger = logger.getChild(`[CallMembership ${sender}:${this.deviceId}]`);\n this.matrixEventData = { eventId, sender };\n }\n\n /** @deprecated use userId instead */\n public get sender(): string {\n return this.userId;\n }\n\n public get userId(): string {\n const { kind, data } = this.membershipData;\n switch (kind) {\n case MembershipKind.RTC:\n return data.member.user_id;\n case MembershipKind.Session:\n default:\n return this.matrixEventData.sender;\n }\n }\n\n public get eventId(): string {\n return this.matrixEventData.eventId;\n }\n\n /**\n * The ID of the MatrixRTC slot that this membership belongs to (format `{application}#{id}`).\n * This is computed in case SessionMembershipData is used.\n */\n public get slotId(): string {\n const { kind, data } = this.membershipData;\n if (data.application === \"m.call\") {\n switch (kind) {\n case MembershipKind.RTC:\n return data.slot_id;\n case MembershipKind.Session:\n default: {\n const [application, id] = [data.application, data.call_id];\n\n // INFO_SLOT_ID_LEGACY_CASE (search for all occurances of this INFO to get the full picture)\n // The spec got changed to use `\"ROOM\"` instead of `\"\"` empyt string for the implicit default call.\n // State events still are sent with `\"\"` however. To find other events that should end up in the same call,\n // we use the slotId.\n // Since the CallMembership is the public representation of a rtc.member event, we just pretend it is a\n // \"ROOM\" slotId/call_id.\n // This makes all the remote members work with just this simple trick.\n //\n // We of course now need to be careful when sending legacy events (state events)\n // They get a slotDescription containing \"ROOM\" since this is what we use starting at the time this comment\n // is commited.\n //\n // See the Other INFO_SLOT_ID_LEGACY_CASE comments to see where we revert back to \"\" just before sending the event.\n let compatibilityAdaptedId: string;\n if (id === \"\") {\n compatibilityAdaptedId = \"ROOM\";\n this.logger?.info(\"use slotId compat hack emptyString -> ROOM\");\n } else {\n compatibilityAdaptedId = id;\n }\n return computeSlotId({\n application,\n id: compatibilityAdaptedId,\n });\n }\n }\n }\n\n this.logger?.info(\"NOT using slotId compat hack emptyString -> ROOM\");\n // This is what the function should look like for any other application that did not\n // go through a `\"\"`=> `\"ROOM\"` rename\n switch (kind) {\n case MembershipKind.RTC:\n return data.slot_id;\n case MembershipKind.Session:\n default:\n return computeSlotId({ application: data.application, id: data.call_id });\n }\n }\n\n public get deviceId(): string {\n const { kind, data } = this.membershipData;\n switch (kind) {\n case MembershipKind.RTC:\n return data.member.device_id;\n case MembershipKind.Session:\n default:\n return data.device_id;\n }\n }\n\n public get callIntent(): RTCCallIntent | undefined {\n const intent = this.applicationData[\"m.call.intent\"];\n if (typeof intent === \"string\") {\n return intent;\n }\n this.logger.warn(\"RTC membership has invalid m.call.intent\");\n return undefined;\n }\n\n /**\n * Parsed `slot_id` (format `{application}#{id}`) into its components (application and id).\n */\n public get slotDescription(): SlotDescription {\n const { kind, data } = this.membershipData;\n if (kind === MembershipKind.RTC) {\n const id = data.slot_id.slice(`${data.application.type}#`.length);\n return { application: data.application.type, id };\n }\n return slotIdToDescription(this.slotId);\n }\n\n /**\n * The application `type`.\n * @deprecated Use @see applicationData\n */\n public get application(): string {\n return this.applicationData.type;\n }\n\n /**\n * Information about the application being used for the RTC session.\n * May contain extra keys specific to the application.\n */\n public get applicationData(): { type: string; [key: string]: unknown } {\n const { kind, data } = this.membershipData;\n switch (kind) {\n case MembershipKind.RTC:\n return data.application;\n case MembershipKind.Session:\n default: {\n // SessionData has no application object: the application's own\n // data sits at the top level beside the session fields, so\n // everything but those is the application's\n const { application, ...rest } = data;\n for (const key of sessionFields) delete rest[key as keyof typeof rest];\n return { ...rest, \"type\": application, \"m.call.intent\": data[\"m.call.intent\"] };\n }\n }\n }\n\n /** @deprecated scope is not used and will be removed in future versions. replaced by application specific types.*/\n public get scope(): SessionMembershipData[\"scope\"] | undefined {\n const { kind, data } = this.membershipData;\n switch (kind) {\n case MembershipKind.RTC:\n return undefined;\n case MembershipKind.Session:\n default:\n return data.scope;\n }\n }\n\n /**\n * This computes the membership ID for the membership.\n * For the sticky event based rtcSessionData this is trivial it is `member.id`.\n * This is not supposed to be used to identity on an rtc backend. This is just a nouance for\n * a generated (sha256) anonymised identity. Only send `rtcBackendIdentity` to any rtc backend service.\n *\n * For the legacy sessionMemberEvents it is a bit more complex. Here we sometimes do not have this data\n * in the event content and we expected the SFU and the client to use `${this.matrixEventData.sender}:${data.device_id}`.\n *\n * So if there is no membershipID we use the hard coded jwt id default (`${this.matrixEventData.sender}:${data.device_id}`)\n * value (used until version 0.16.0)\n *\n * It is also possible for a session event to set a custom membershipID. in that case this will be used.\n */\n public get memberId(): string {\n // the createdTs behaves equivalent to the membershipID.\n // we only need the field for the legacy member events where we needed to update them\n // synapse ignores sending state events if they have the same content.\n const { kind, data } = this.membershipData;\n switch (kind) {\n case \"rtc\":\n return data.member.id;\n case \"session\":\n return (\n // best case we have a client already publishing the right custom membershipId\n data.membershipID ??\n // alternativly we use the hard coded jwt id defuatl value (used until version 0.16.0)\n `${this.matrixEventData.sender}:${data.device_id}`\n );\n default:\n throw Error(\"Not possible to get memberID without knowing the membership event kind\");\n }\n }\n\n /**\n * @deprecated renamed to `memberId`\n */\n public get membershipID(): string {\n return this.memberId;\n }\n\n public createdTs(): number {\n const { kind, data } = this.membershipData;\n switch (kind) {\n case MembershipKind.RTC:\n // TODO we need to read the referenced (relation) event if available to get the real created_ts\n return this.matrixEvent.getTs();\n case MembershipKind.Session:\n default:\n return data.created_ts ?? this.matrixEvent.getTs();\n }\n }\n\n /**\n * Gets the absolute expiry timestamp of the membership.\n * @returns The absolute expiry time of the membership as a unix timestamp in milliseconds or undefined if not applicable\n */\n public getAbsoluteExpiry(): number | undefined {\n const { kind, data } = this.membershipData;\n switch (kind) {\n case MembershipKind.RTC:\n return undefined;\n case MembershipKind.Session:\n default:\n // TODO: calculate this from the MatrixRTCSession join configuration directly\n return this.createdTs() + (data.expires ?? DEFAULT_EXPIRE_DURATION);\n }\n }\n\n /**\n * @returns The number of milliseconds until the membership expires or undefined if applicable\n * @deprecated Not used by RTC events.\n */\n public getMsUntilExpiry(): number | undefined {\n const { kind } = this.membershipData;\n if (kind === MembershipKind.Session) {\n const absExpiry = this.getAbsoluteExpiry();\n if (absExpiry) {\n // Assume that local clock is sufficiently in sync with other clocks in the distributed system.\n // We used to try and adjust for the local clock being skewed, but there are cases where this is not accurate.\n // The current implementation allows for the local clock to be -infinity to +MatrixRTCSession.MEMBERSHIP_EXPIRY_TIME/2\n return absExpiry - Date.now();\n }\n }\n return undefined;\n }\n\n /**\n * @returns true if the membership has expired, otherwise false\n */\n public isExpired(): boolean {\n const { kind } = this.membershipData;\n switch (kind) {\n case MembershipKind.RTC:\n return false;\n case MembershipKind.Session:\n default:\n return this.getMsUntilExpiry()! <= 0;\n }\n }\n\n /**\n * ## RTC Membership\n * Gets the primary transport to use for this RTC membership (m.rtc.member).\n * This will return the primary transport that is used by this call membership to publish their media.\n * Directly relates to the `transports.published` field.\n *\n * ## Legacy session membership\n * In case of a legacy session membership (m.call.member) this will return the selected transport where\n * media is published. How this selection happens depends on the `focus_active` field of the session membership.\n * If the `focus_selection` is `oldest_membership` this will return the transport of the oldest membership\n * in the room (based on the `created_ts` field of the session membership).\n * If the `focus_selection` is `multi_sfu` it will return the first transport of the `foci_preferred` list.\n * (`multi_sfu` is equivalent to how `m.rtc.member` `transports.published` work).\n * @param oldestMembership For backwards compatibility with session membership (legacy). Unused in case of RTC membership.\n * Always required to make the consumer not care if it deals with RTC or session memberships.\n * @returns The transport this membership uses to publish media or undefined if no transport is available.\n */\n public getTransport(oldestMembership: CallMembership): Transport | undefined {\n const { kind, data } = this.membershipData;\n switch (kind) {\n case MembershipKind.RTC:\n return data.transports.published[0];\n case MembershipKind.Session:\n switch (data.focus_active.focus_selection) {\n case \"oldest_membership\":\n if (CallMembership.equal(this, oldestMembership)) return data.foci_preferred[0];\n if (oldestMembership !== undefined) return oldestMembership.getTransport(oldestMembership);\n break;\n case \"multi_sfu\":\n return data.foci_preferred[0];\n default:\n // `focus_selection` not understood.\n return undefined;\n }\n break;\n default:\n return undefined;\n }\n }\n\n /**\n * The value of the `transports.published` field for RTC memberships (m.rtc.member).\n * Or the value of the `foci_preferred` field for legacy session memberships (m.call.member).\n */\n public get transports(): Transport[] {\n const { kind, data } = this.membershipData;\n switch (kind) {\n case MembershipKind.RTC:\n return data.transports.published;\n case MembershipKind.Session:\n default:\n return data.foci_preferred;\n }\n }\n}\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAS,WAAW,QAAQ,aAAa;AAGzC,SAAsB,MAAM,QAAQ,cAAc;A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,KAAK,cAAc,CAAC,GAAG;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS;MACpC,KAAK,cAAc,CAAC,OAAO;MAC3B;QACI,OAAO,IAAI,CAAC,cAAc;IAClC;EACJ;AACJ","ignoreList":[]}
|
|
@@ -90,5 +90,10 @@ export interface IMembershipManager extends TypedEventEmitter<MembershipManagerE
|
|
|
90
90
|
* @param callIntent The new intent to set.
|
|
91
91
|
*/
|
|
92
92
|
updateCallIntent(callIntent: RTCCallIntent): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Replace the application-specific data of our membership (see
|
|
95
|
+
* `SessionConfig.applicationData`), re-sending the membership if it changed.
|
|
96
|
+
*/
|
|
97
|
+
updateApplicationData(applicationData: Record<string, unknown>): Promise<void>;
|
|
93
98
|
}
|
|
94
99
|
//# sourceMappingURL=IMembershipManager.d.ts.map
|
|
@@ -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;IACvE,CAAC,sBAAsB,CAAC,cA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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 we are trying to join, or have successfully joined the session.\n * It does not reflect if the room state is already configured to represent us being joined.\n * It only means that the Manager should be trying to connect or to disconnect running.\n * The Manager is still running right after isJoined becomes false to send the disconnect events.\n * @returns true if we intend to be participating in the MatrixRTC session\n * @deprecated This name is confusing and replaced by `isActivated()`. (Returns the same as `isActivated()`)\n */\n isJoined(): boolean;\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 fociPreferred the list of preferred foci to use in the joined RTC membership event.\n * If multiSfuFocus is set, this is only needed if this client wants to publish to multiple transports simultaneously.\n * @param multiSfuFocus the active focus to use in the joined RTC membership event. Setting this implies the\n * membership manager will operate in a multi-SFU connection mode. If `undefined`, an `oldest_membership`\n * transport selection will be used instead.\n * @throws can throw if it exceeds a configured maximum retry.\n */\n join(fociPreferred: Transport[], multiSfuFocus?: 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"],"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
|
+
{"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 we are trying to join, or have successfully joined the session.\n * It does not reflect if the room state is already configured to represent us being joined.\n * It only means that the Manager should be trying to connect or to disconnect running.\n * The Manager is still running right after isJoined becomes false to send the disconnect events.\n * @returns true if we intend to be participating in the MatrixRTC session\n * @deprecated This name is confusing and replaced by `isActivated()`. (Returns the same as `isActivated()`)\n */\n isJoined(): boolean;\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 fociPreferred the list of preferred foci to use in the joined RTC membership event.\n * If multiSfuFocus is set, this is only needed if this client wants to publish to multiple transports simultaneously.\n * @param multiSfuFocus the active focus to use in the joined RTC membership event. Setting this implies the\n * membership manager will operate in a multi-SFU connection mode. If `undefined`, an `oldest_membership`\n * transport selection will be used instead.\n * @throws can throw if it exceeds a configured maximum retry.\n */\n join(fociPreferred: Transport[], multiSfuFocus?: 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":[]}
|
|
@@ -39,6 +39,14 @@ export interface SessionConfig {
|
|
|
39
39
|
* Determines the kind of call this will be.
|
|
40
40
|
*/
|
|
41
41
|
callIntent?: RTCCallIntent;
|
|
42
|
+
/**
|
|
43
|
+
* Application-specific data to publish in our membership alongside the
|
|
44
|
+
* application `type` and `m.call.intent`: in the `application` object of
|
|
45
|
+
* an `m.rtc.member` event, or at the top level of a legacy `m.call.member`
|
|
46
|
+
* one. Keys should be namespaced. Read back through
|
|
47
|
+
* {@link CallMembership.applicationData}.
|
|
48
|
+
*/
|
|
49
|
+
applicationData?: Record<string, unknown>;
|
|
42
50
|
/**
|
|
43
51
|
* How long (in milliseconds) the callee's client should keep ringing/waiting for an
|
|
44
52
|
* answer before the sender gives up and the call notification is considered timed out.
|
|
@@ -236,6 +244,13 @@ export declare class MatrixRTCSession extends TypedEventEmitter<MatrixRTCSession
|
|
|
236
244
|
* if no slot exists.
|
|
237
245
|
*/
|
|
238
246
|
isSlotClosed(): boolean | undefined;
|
|
247
|
+
/**
|
|
248
|
+
* Whether this session's slot is open.
|
|
249
|
+
*
|
|
250
|
+
* @returns `true` if the slot is open, `false` if the slot is closed or `undefined`
|
|
251
|
+
* if no slot exists.
|
|
252
|
+
*/
|
|
253
|
+
isSlotOpen(): boolean | undefined;
|
|
239
254
|
/**
|
|
240
255
|
* Ensures this session's slot is open, sending a slot state event to open (or create) it if needed.
|
|
241
256
|
*
|
|
@@ -351,6 +366,11 @@ export declare class MatrixRTCSession extends TypedEventEmitter<MatrixRTCSession
|
|
|
351
366
|
*/
|
|
352
367
|
getConsensusCallIntent(): RTCCallIntent | undefined;
|
|
353
368
|
updateCallIntent(callIntent: RTCCallIntent): Promise<void>;
|
|
369
|
+
/**
|
|
370
|
+
* Replace the application-specific data in our membership (see
|
|
371
|
+
* {@link SessionConfig.applicationData}), re-sending it if it changed.
|
|
372
|
+
*/
|
|
373
|
+
updateApplicationData(applicationData: Record<string, unknown>): Promise<void>;
|
|
354
374
|
/**
|
|
355
375
|
* Re-emit an EncryptionKeyChanged event for each tracked encryption key. This can be used to export
|
|
356
376
|
* the keys.
|
|
@@ -368,6 +388,10 @@ export declare class MatrixRTCSession extends TypedEventEmitter<MatrixRTCSession
|
|
|
368
388
|
* @param callIntent The type of call this is (e.g. "audio").
|
|
369
389
|
*/
|
|
370
390
|
private sendCallNotify;
|
|
391
|
+
/**
|
|
392
|
+
* Sends a notification event, as a sticky event (MSC4354) where the server supports it.
|
|
393
|
+
*/
|
|
394
|
+
private sendNotificationEvent;
|
|
371
395
|
/**
|
|
372
396
|
* Call this when the Matrix room members have changed.
|
|
373
397
|
*/
|
|
@@ -382,6 +406,8 @@ export declare class MatrixRTCSession extends TypedEventEmitter<MatrixRTCSession
|
|
|
382
406
|
private readonly onStickyEventUpdate;
|
|
383
407
|
/**
|
|
384
408
|
* Call this when something changed that may impacts the current MatrixRTC members in this session.
|
|
409
|
+
*
|
|
410
|
+
* @deprecated use {@link ensureRecalculateSessionMembers} instead.
|
|
385
411
|
*/
|
|
386
412
|
_onRTCSessionMemberUpdate: () => Promise<void>;
|
|
387
413
|
private recalculateSessionMembersPromise;
|
|
@@ -390,7 +416,7 @@ export declare class MatrixRTCSession extends TypedEventEmitter<MatrixRTCSession
|
|
|
390
416
|
* Also ensures that only one recalculation is made at a time.
|
|
391
417
|
* @returns A promise resolving when the state has been recalculated.
|
|
392
418
|
*/
|
|
393
|
-
|
|
419
|
+
ensureRecalculateSessionMembers(): Promise<void>;
|
|
394
420
|
/**
|
|
395
421
|
* Call this when anything that could impact rtc memberships has changed: Room Members or RTC members.
|
|
396
422
|
*
|
|
@@ -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,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD,OAAO,EAAE,KAAK,2BAA2B,EAA2B,MAAM,wBAAwB,CAAC;AAEnG,OAAO,KAAK,EACR,UAAU,EACV,mBAAmB,EACnB,MAAM,EACN,uBAAuB,EACvB,aAAa,EACb,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,wBAAwB,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AAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAM1F;IAED;;;OAGG;IACI,oBAAoB,IAAI,IAAI,CAYlC;IAED;;OAEG;IACH,OAAO,CAAC,cAAc;IAqBtB;;;;;;OAMG;IACH,OAAO,CAAC,cAAc;IAsCtB;;OAEG;YACW,qBAAqB;IAoBnC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAEjC;IAEF;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAI/B;IAEF;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAYlC;IAEF;;;;OAIG;IACI,yBAAyB,QAAa,OAAO,CAAC,IAAI,CAAC,CAExD;IAGF,OAAO,CAAC,gCAAgC,CAAoC;IAE5E;;;;OAIG;IACI,+BAA+B,IAAI,OAAO,CAAC,IAAI,CAAC,CAYtD;IAED;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CA0DxC;CACL"}
|
|
@@ -25,12 +25,15 @@ import { CallMembership } from "./CallMembership.js";
|
|
|
25
25
|
import { RoomStateEvent } from "../models/room-state.js";
|
|
26
26
|
import { MembershipManager, StickyEventMembershipManager } from "./MembershipManager.js";
|
|
27
27
|
import { deepCompare, logDurationSync } from "../utils.js";
|
|
28
|
+
import { RTC_NOTIFICATION_MAX_SENDER_TS_AHEAD_MS } from "./types.js";
|
|
29
|
+
import { isLeftMembershipContent } from "./membershipData/index.js";
|
|
30
|
+
import { UnsupportedStickyEventsEndpointError } from "../errors.js";
|
|
28
31
|
import { MembershipManagerEvent } from "./IMembershipManager.js";
|
|
29
32
|
import { RTCEncryptionManager } from "./RTCEncryptionManager.js";
|
|
30
33
|
import { ToDeviceKeyTransport } from "./ToDeviceKeyTransport.js";
|
|
31
34
|
import { TypedReEmitter } from "../ReEmitter.js";
|
|
32
35
|
import { RoomStickyEventsEvent } from "../models/room-sticky-events.js";
|
|
33
|
-
import { computeSlotId } from "./utils.js";
|
|
36
|
+
import { computeSlotId, getSlotEventContent, isSlotClosed, isSlotOpen } from "./utils.js";
|
|
34
37
|
|
|
35
38
|
/**
|
|
36
39
|
* Events emitted by MatrixRTCSession
|
|
@@ -128,6 +131,16 @@ export class MatrixRTCSession extends TypedEventEmitter {
|
|
|
128
131
|
return isSlotClosed(this.roomSubset, this.slotDescription);
|
|
129
132
|
}
|
|
130
133
|
|
|
134
|
+
/**
|
|
135
|
+
* Whether this session's slot is open.
|
|
136
|
+
*
|
|
137
|
+
* @returns `true` if the slot is open, `false` if the slot is closed or `undefined`
|
|
138
|
+
* if no slot exists.
|
|
139
|
+
*/
|
|
140
|
+
isSlotOpen() {
|
|
141
|
+
return isSlotOpen(this.roomSubset, this.slotDescription);
|
|
142
|
+
}
|
|
143
|
+
|
|
131
144
|
/**
|
|
132
145
|
* Ensures this session's slot is open, sending a slot state event to open (or create) it if needed.
|
|
133
146
|
*
|
|
@@ -284,12 +297,13 @@ export class MatrixRTCSession extends TypedEventEmitter {
|
|
|
284
297
|
});
|
|
285
298
|
/**
|
|
286
299
|
* Call this when something changed that may impacts the current MatrixRTC members in this session.
|
|
300
|
+
*
|
|
301
|
+
* @deprecated use {@link ensureRecalculateSessionMembers} instead.
|
|
287
302
|
*/
|
|
288
|
-
// We allow this name schema since this function should only be used for testing purposes.
|
|
289
303
|
_defineProperty(this, "_onRTCSessionMemberUpdate", async () => {
|
|
290
|
-
await this.
|
|
304
|
+
await this.ensureRecalculateSessionMembers();
|
|
291
305
|
});
|
|
292
|
-
//
|
|
306
|
+
// Recalculations are chained onto this promise, so they never run in parallel.
|
|
293
307
|
_defineProperty(this, "recalculateSessionMembersPromise", Promise.resolve());
|
|
294
308
|
/**
|
|
295
309
|
* Call this when anything that could impact rtc memberships has changed: Room Members or RTC members.
|
|
@@ -491,6 +505,18 @@ export class MatrixRTCSession extends TypedEventEmitter {
|
|
|
491
505
|
await this.membershipManager?.updateCallIntent(callIntent);
|
|
492
506
|
}
|
|
493
507
|
|
|
508
|
+
/**
|
|
509
|
+
* Replace the application-specific data in our membership (see
|
|
510
|
+
* {@link SessionConfig.applicationData}), re-sending it if it changed.
|
|
511
|
+
*/
|
|
512
|
+
async updateApplicationData(applicationData) {
|
|
513
|
+
const myMembership = this.membershipManager?.ownMembership;
|
|
514
|
+
if (!myMembership) {
|
|
515
|
+
throw Error("Not connected yet");
|
|
516
|
+
}
|
|
517
|
+
await this.membershipManager?.updateApplicationData(applicationData);
|
|
518
|
+
}
|
|
519
|
+
|
|
494
520
|
/**
|
|
495
521
|
* Re-emit an EncryptionKeyChanged event for each tracked encryption key. This can be used to export
|
|
496
522
|
* the keys.
|
|
@@ -534,8 +560,10 @@ export class MatrixRTCSession extends TypedEventEmitter {
|
|
|
534
560
|
*/
|
|
535
561
|
sendCallNotify(parentEventId, notificationType, callIntent) {
|
|
536
562
|
const lifetime = this.joinConfig?.notificationLifetimeMs ?? 90000;
|
|
563
|
+
const slotId = computeSlotId(this.slotDescription);
|
|
537
564
|
const sendNotificationEvent = async () => {
|
|
538
565
|
const content = {
|
|
566
|
+
"slot_id": slotId,
|
|
539
567
|
"m.mentions": {
|
|
540
568
|
user_ids: [],
|
|
541
569
|
room: true
|
|
@@ -546,14 +574,14 @@ export class MatrixRTCSession extends TypedEventEmitter {
|
|
|
546
574
|
rel_type: RelationType.Reference
|
|
547
575
|
},
|
|
548
576
|
"sender_ts": Date.now(),
|
|
549
|
-
"lifetime": lifetime
|
|
577
|
+
"lifetime": lifetime,
|
|
578
|
+
"msc4354_sticky_key": slotId
|
|
550
579
|
};
|
|
551
580
|
if (callIntent) {
|
|
552
581
|
content["m.call.intent"] = callIntent;
|
|
553
582
|
}
|
|
554
|
-
const response = await this.client.sendEvent(this.roomSubset.roomId, EventType.RTCNotification, content);
|
|
555
583
|
return {
|
|
556
|
-
response,
|
|
584
|
+
response: await this.sendNotificationEvent(content),
|
|
557
585
|
content
|
|
558
586
|
};
|
|
559
587
|
};
|
|
@@ -561,7 +589,24 @@ export class MatrixRTCSession extends TypedEventEmitter {
|
|
|
561
589
|
// Join event_id and origin event content
|
|
562
590
|
const newResult = _objectSpread(_objectSpread({}, notification.response), notification.content);
|
|
563
591
|
this.emit(MatrixRTCSessionEvent.DidSendCallNotification, newResult);
|
|
564
|
-
}).catch(
|
|
592
|
+
}).catch(error => this.logger.error("Failed to send call notification", error));
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Sends a notification event, as a sticky event (MSC4354) where the server supports it.
|
|
597
|
+
*/
|
|
598
|
+
async sendNotificationEvent(content) {
|
|
599
|
+
const roomId = this.roomSubset.roomId;
|
|
600
|
+
try {
|
|
601
|
+
// Stay sticky slightly longer than the lifetime, since the server measures the sticky duration
|
|
602
|
+
// from `origin_server_ts` while receivers measure the lifetime from `sender_ts`.
|
|
603
|
+
const stickyDurationMs = content.lifetime + RTC_NOTIFICATION_MAX_SENDER_TS_AHEAD_MS;
|
|
604
|
+
return await this.client._unstable_sendStickyEvent(roomId, stickyDurationMs, null, EventType.RTCNotification, content);
|
|
605
|
+
} catch (error) {
|
|
606
|
+
if (!(error instanceof UnsupportedStickyEventsEndpointError)) throw error;
|
|
607
|
+
this.logger.debug("Server does not support sticky events, sending notification as a regular event");
|
|
608
|
+
return await this.client.sendEvent(roomId, EventType.RTCNotification, content);
|
|
609
|
+
}
|
|
565
610
|
}
|
|
566
611
|
/**
|
|
567
612
|
* Ensures that membership is recalculated when the state of the session may have changed.
|
|
@@ -587,7 +632,7 @@ async function computeBackendIdentityAndVerifyMemberEvents(room, callMemberEvent
|
|
|
587
632
|
const content = memberEvent.getContent();
|
|
588
633
|
|
|
589
634
|
// Quick filter to avoid unneeded processing of invalid events or left events.
|
|
590
|
-
if (!quickFilterNonRelevantContents(content
|
|
635
|
+
if (!quickFilterNonRelevantContents(content)) {
|
|
591
636
|
continue;
|
|
592
637
|
}
|
|
593
638
|
try {
|
|
@@ -601,11 +646,12 @@ async function computeBackendIdentityAndVerifyMemberEvents(room, callMemberEvent
|
|
|
601
646
|
}
|
|
602
647
|
return callMemberships;
|
|
603
648
|
}
|
|
604
|
-
function quickFilterNonRelevantContents(content
|
|
649
|
+
function quickFilterNonRelevantContents(content) {
|
|
650
|
+
// Don't even bother about left memberships (saves us from costly type/"key in" checks in bigger rooms)
|
|
651
|
+
if (isLeftMembershipContent(content)) return false;
|
|
652
|
+
|
|
605
653
|
// Ignore sticky keys for the count
|
|
606
654
|
const eventKeysCount = Object.keys(content).filter(k => k !== "msc4354_sticky_key").length;
|
|
607
|
-
// Don't even bother about empty events (saves us from costly type/"key in" checks in bigger rooms)
|
|
608
|
-
if (eventKeysCount === 0) return false;
|
|
609
655
|
|
|
610
656
|
// We first decide if it's a MSC4143 event (per device state key)
|
|
611
657
|
if (eventKeysCount > 1 && "application" in content) {
|
|
@@ -636,30 +682,6 @@ function isValidMembership(membership, room, slotDescription, logger) {
|
|
|
636
682
|
return true;
|
|
637
683
|
}
|
|
638
684
|
|
|
639
|
-
/**
|
|
640
|
-
* Reads the slot state event's content for the given slot description.
|
|
641
|
-
*
|
|
642
|
-
* @returns The slot event's content, or `undefined` if no slot event exists for the given description.
|
|
643
|
-
*/
|
|
644
|
-
function getSlotEventContent(room, slotDescription) {
|
|
645
|
-
const slotId = computeSlotId(slotDescription);
|
|
646
|
-
const slotEvent = room.getLiveTimeline().getState(EventTimeline.FORWARDS)?.getStateEvents(EventType.RTCSlot, slotId);
|
|
647
|
-
if (!slotEvent) return undefined;
|
|
648
|
-
return slotEvent.getContent();
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
/**
|
|
652
|
-
* Whether the given slot is closed.
|
|
653
|
-
*
|
|
654
|
-
* @returns `true` if the slot is closed, `false` if the slot is open or `undefined`
|
|
655
|
-
* if no slot exists.
|
|
656
|
-
*/
|
|
657
|
-
function isSlotClosed(room, slotDescription) {
|
|
658
|
-
const content = getSlotEventContent(room, slotDescription);
|
|
659
|
-
if (content === undefined) return undefined;
|
|
660
|
-
return content.status !== "open" || typeof content.application !== "object" || content.application?.type !== slotDescription.application;
|
|
661
|
-
}
|
|
662
|
-
|
|
663
685
|
/**
|
|
664
686
|
* Collects the raw member events from room state and sticky store.
|
|
665
687
|
*/
|