From 70608c2a96a11953e0bf3bf197bb81d852df801d Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Fri, 7 May 2021 11:49:46 +0100 Subject: [PATCH] Use MatrixStickerBot.getUserId --- package-lock.json | 13 ------------- src/api/dimension/DimensionBigBlueButtonService.ts | 8 ++++++-- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0c12123..6b89a30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2110,14 +2110,6 @@ "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", "dev": true }, - "bigbluebutton-api-js": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/bigbluebutton-api-js/-/bigbluebutton-api-js-2.2.1.tgz", - "integrity": "sha512-pkLc3tur/5UPLlC7hlCfR0fta3ajbVtO48IzIn10Tkm00Ren1OP89cp1i1dfRUVroGq1K4VwqIOpUPWlHghw/w==", - "requires": { - "jssha": "^3.2.0" - } - }, "binary-extensions": { "version": "1.13.1", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", @@ -6959,11 +6951,6 @@ "verror": "1.10.0" } }, - "jssha": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jssha/-/jssha-3.2.0.tgz", - "integrity": "sha512-QuruyBENDWdN4tZwJbQq7/eAK85FqrI4oDbXjy5IBhYD+2pTJyBUWZe8ctWaCkrV0gy6AaelgOZZBMeswEa/6Q==" - }, "killable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", diff --git a/src/api/dimension/DimensionBigBlueButtonService.ts b/src/api/dimension/DimensionBigBlueButtonService.ts index 9b6b675..2a71d42 100644 --- a/src/api/dimension/DimensionBigBlueButtonService.ts +++ b/src/api/dimension/DimensionBigBlueButtonService.ts @@ -10,6 +10,7 @@ import { sha256 } from "../../utils/hashing"; import config from "../../config"; import { parseStringPromise } from "xml2js"; import * as randomString from "random-string"; +import { MatrixStickerBot } from "../../matrix/MatrixStickerBot"; /** * API for the BigBlueButton widget. @@ -207,18 +208,21 @@ export class DimensionBigBlueButtonService { // the attendee or moderator one. const attendeePassword = createResponse.attendeePW[0]; - // TODO: How do we get the user dimension is actually running as? - const widgetCreatorUserId = "@dimension:" + config.homeserver.name; + // Retrieve the user ID that dimension is running as + const widgetCreatorUserId = await MatrixStickerBot.getUserId(); // Add all necessary client variables to the url when loading the widget const widgetUrl = config.dimension.publicUrl + "/widgets/bigbluebutton" + "?widgetId=$matrix_widget_id" + "&roomId=$matrix_room_id" + + // Indicate that we would like to join a meeting created by Dimension, rather than doing so via + // a greenlight URL "&createMeeting=true" + "&displayName=$matrix_display_name" + "&avatarUrl=$matrix_avatar_url" + "&userId=$matrix_user_id" + + // Provide the meeting details in the state event `&meetingId=${createResponse.meetingID[0]}` + `&meetingPassword=${attendeePassword}` + "&auth=$openidtoken-jwt";