Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(external-api): send full user context (#17147)

Mihaela Dumitru5ad6332632c1
diff --git a/react/features/base/conference/functions.ts b/react/features/base/conference/functions.ts
index ac4760b737..849c20ad0f 100644
--- a/react/features/base/conference/functions.ts
+++ b/react/features/base/conference/functions.ts
@@ -95,12 +95,6 @@ export function commonUserJoinedHandling(
const isPromoted = conference?.getMetadataHandler().getMetadata()?.visitors?.promoted?.[id];
const userIdentity = user.getIdentity()?.user;
- // Map identity from JWT context to userContext for external API
- const userContext = userIdentity ? {
- id: userIdentity.id,
- name: userIdentity.name
- } : undefined;
-
// the identity and avatar come from jwt and never change in the presence
dispatch(participantJoined({
avatarURL: userIdentity?.avatar,
@@ -113,7 +107,7 @@ export function commonUserJoinedHandling(
isPromoted,
isReplacing,
sources: user.getSources(),
- userContext
+ userContext: userIdentity
}));
}
}
diff --git a/react/features/base/participants/middleware.ts b/react/features/base/participants/middleware.ts
index d5575503fc..14ff70a412 100644
--- a/react/features/base/participants/middleware.ts
+++ b/react/features/base/participants/middleware.ts
@@ -619,17 +619,12 @@ function _localParticipantJoined({ getState, dispatch }: IStore, next: Function,
const settings = state['features/base/settings'];
const jwtUser = state['features/base/jwt']?.user;
- const userContext = jwtUser ? {
- id: jwtUser.id,
- name: jwtUser.name
- } : undefined;
-
dispatch(localParticipantJoined({
avatarURL: settings.avatarURL,
email: settings.email,
name: settings.displayName,
id: '',
- userContext
+ userContext: jwtUser
}));
return result;
diff --git a/react/features/base/participants/types.ts b/react/features/base/participants/types.ts
index 4f7ad48862..5ea2d9136f 100644
--- a/react/features/base/participants/types.ts
+++ b/react/features/base/participants/types.ts
@@ -45,6 +45,7 @@ export interface IParticipant {
}
export interface IUserContext {
+ [key: string]: any;
id?: string;
name?: string;
}
diff --git a/react/features/breakout-rooms/reducer.ts b/react/features/breakout-rooms/reducer.ts
index 964064b6ac..9223ca9206 100644
--- a/react/features/breakout-rooms/reducer.ts
+++ b/react/features/breakout-rooms/reducer.ts
@@ -19,6 +19,7 @@ export interface IBreakoutRoomsState {
rooms: IRooms;
userContextCache: {
[participantId: string]: {
+ [key: string]: any;
id?: string;
name?: string;
};
diff --git a/react/features/breakout-rooms/types.ts b/react/features/breakout-rooms/types.ts
index b7fde49ac8..1828c4c42a 100644
--- a/react/features/breakout-rooms/types.ts
+++ b/react/features/breakout-rooms/types.ts
@@ -9,6 +9,7 @@ export interface IRoom {
jid: string;
role: string;
userContext?: {
+ [key: string]: any;
id?: string;
name?: string;
};
@@ -38,6 +39,7 @@ export interface IRoomInfoParticipant {
jid: string;
role: string;
userContext?: {
+ [key: string]: any;
id?: string;
name?: string;
};