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:
@@ -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) {
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user