mirror of
https://github.com/vector-im/element-call.git
synced 2026-10-16 23:45:50 +00:00
Match LiveKit participants against all backend identities
A member authenticated through the legacy JWT endpoint publishes under a `user:device` identity, while one authenticated through the default endpoint publishes under a hashed identity. Both are listed in the membership's backend identities, so match against the whole list rather than only the primary one.
This commit is contained in:
@@ -111,8 +111,8 @@ export function createRemoteMatrixLivekitMembers$({
|
|||||||
const participants = transport
|
const participants = transport
|
||||||
? managerData.getParticipantsForTransport(transport)
|
? managerData.getParticipantsForTransport(transport)
|
||||||
: [];
|
: [];
|
||||||
const matches = participants.filter(
|
const matches = participants.filter((p) =>
|
||||||
(p) => p.identity == membership.rtcBackendIdentity,
|
membership.backendIdentities.includes(p.identity),
|
||||||
);
|
);
|
||||||
const participant = matches[0] ?? null;
|
const participant = matches[0] ?? null;
|
||||||
const connection = transport
|
const connection = transport
|
||||||
|
|||||||
+4
-3
@@ -261,11 +261,12 @@ export function mockRtcMembership(
|
|||||||
content: data,
|
content: data,
|
||||||
});
|
});
|
||||||
|
|
||||||
const membershipData = CallMembership.membershipDataFromMatrixEvent(event);
|
const backendIdentity = rtcBackendIdentity ?? `${userId}:${deviceId}`;
|
||||||
const cms = new CallMembership(
|
const cms = new CallMembership(
|
||||||
event,
|
event,
|
||||||
membershipData,
|
CallMembership.membershipDataFromMatrixEvent(event),
|
||||||
rtcBackendIdentity ?? `${userId}:${deviceId}`,
|
[backendIdentity],
|
||||||
|
backendIdentity,
|
||||||
);
|
);
|
||||||
vi.mocked(cms).getTransport = vi.fn().mockReturnValue(fociPreferred[0]);
|
vi.mocked(cms).getTransport = vi.fn().mockReturnValue(fociPreferred[0]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user