Use MatrixStickerBot.getUserId

This commit is contained in:
Andrew Morgan 2021-05-07 11:49:46 +01:00
parent a06e002c28
commit 70608c2a96
2 changed files with 6 additions and 15 deletions

13
package-lock.json generated
View file

@ -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",

View file

@ -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";