Adding a new "jitsiNoPrefix" property.

When set to "true", WorkAdventure will NOT prefix the Jitsi room name with a hash, gicing full control to the user over the Jitsi room name.
This commit is contained in:
David Négrier
2022-04-16 11:36:10 +02:00
parent b89997c9f1
commit 8c5c680cfb
5 changed files with 30 additions and 8 deletions
@@ -15,6 +15,7 @@ export enum GameMapProperties {
JITSI_TRIGGER_MESSAGE = "jitsiTriggerMessage",
JITSI_URL = "jitsiUrl",
JITSI_WIDTH = "jitsiWidth",
JITSI_NO_PREFIX = "jitsiNoPrefix",
NAME = "name",
OPEN_TAB = "openTab",
OPEN_WEBSITE = "openWebsite",
@@ -67,7 +67,11 @@ export class GameMapPropertiesListener {
});
} else {
const openJitsiRoomFunction = () => {
const roomName = jitsiFactory.getRoomName(newValue.toString(), this.scene.roomUrl);
let addPrefix = true;
if (allProps.get(GameMapProperties.JITSI_NO_PREFIX)) {
addPrefix = false;
}
const roomName = jitsiFactory.getRoomName(newValue.toString(), this.scene.roomUrl, addPrefix);
const jitsiUrl = allProps.get(GameMapProperties.JITSI_URL) as string | undefined;
if (JITSI_PRIVATE_MODE && !jitsiUrl) {
+2 -2
View File
@@ -136,8 +136,8 @@ class JitsiFactory {
/**
* Slugifies the room name and prepends the room name with the instance
*/
public getRoomName(roomName: string, roomId: string): string {
return slugify(StringUtils.shortHash(roomId) + "-" + roomName);
public getRoomName(roomName: string, roomId: string, addPrefix: boolean): string {
return slugify((addPrefix ? StringUtils.shortHash(roomId) + "-" : "") + roomName);
}
public start(