Skip to content

Commit 1c19393

Browse files
daroncofcecagno
authored andcommitted
Pass user tags as metadata when creating a BigBlueButton session
User tags prefixed by `bbb-meta-` will be passed as metadata on the BigBlueButton `create` call. Use tags in the format: `bbb-meta-my-key=value`
1 parent cdfb73c commit 1c19393

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

back/src/Services/SocketManager.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,16 @@ export class SocketManager {
933933

934934
// This is idempotent, so we call it on each join in order to be sure that the meeting exists.
935935
const createOptions = { attendeePW, moderatorPW, record: true };
936-
const createURL = api.administration.create(meetingName, meetingId, createOptions);
936+
const metadata = user.tags
937+
.filter((tag) => tag.startsWith("bbb-meta-"))
938+
.map((tag) => tag.replace("bbb-meta-", "meta_"));
939+
const metadataHash: Record<string, string> = {};
940+
metadata.forEach((item) => {
941+
const [key, value] = item.split("=");
942+
metadataHash[key] = value;
943+
});
944+
945+
const createURL = api.administration.create(meetingName, meetingId, { ...createOptions, ...metadataHash });
937946
await BigbluebuttonJs.http(createURL);
938947

939948
const joinParams: Record<string, string> = {};

0 commit comments

Comments
 (0)