Skip to content

Commit bc57a3f

Browse files
authored
[MatrixRTC] Do not sent the livekit_alias in sticky events (#5165)
* Do not sent the livekit_alias in sticky events * tests
1 parent f136f6d commit bc57a3f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

spec/unit/matrixrtc/MembershipManager.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ describe("MembershipManager", () => {
970970
device_id: "AAAAAAA",
971971
},
972972
slot_id: "m.call#",
973-
rtc_transports: [focus],
973+
rtc_transports: [{ type: focus.type, livekit_service_url: focus.livekit_service_url }],
974974
versions: [],
975975
msc4354_sticky_key: "@alice:example.org:AAAAAAA_m.call",
976976
},

src/matrixrtc/MembershipManager.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import {
4343
type IMembershipManager,
4444
type MembershipManagerEventHandlerMap,
4545
} from "./IMembershipManager.ts";
46+
import { isLivekitTransportConfig } from "./LivekitTransport.ts";
4647

4748
/* MembershipActionTypes:
4849
On Join: ───────────────┐ ┌───────────────(1)───────────┐
@@ -1092,6 +1093,7 @@ export class StickyEventMembershipManager extends MembershipManager {
10921093
protected makeMyMembership(expires: number): SessionMembershipData | RtcMembershipData {
10931094
const ownMembership = this.ownMembership;
10941095

1096+
const livekitTransport = isLivekitTransportConfig(this.rtcTransport) ? this.rtcTransport : undefined;
10951097
const relationObject = ownMembership?.eventId
10961098
? { "m.relation": { rel_type: RelationType.Reference, event_id: ownMembership?.eventId } }
10971099
: {};
@@ -1101,7 +1103,11 @@ export class StickyEventMembershipManager extends MembershipManager {
11011103
...(this.callIntent ? { "m.call.intent": this.callIntent } : {}),
11021104
},
11031105
slot_id: slotDescriptionToId(this.slotDescription),
1104-
rtc_transports: this.rtcTransport ? [this.rtcTransport] : [],
1106+
// Make sure we do not add the alias to the transport.
1107+
// It is not needed in matrix2.0. The additional session information will be used to find the right alias on the sfu.
1108+
rtc_transports: livekitTransport
1109+
? [{ type: livekitTransport.type, livekit_service_url: livekitTransport.livekit_service_url }]
1110+
: [],
11051111
member: { device_id: this.deviceId, user_id: this.userId, id: this.memberId },
11061112
versions: [],
11071113
...relationObject,

0 commit comments

Comments
 (0)