diff --git a/meshcentral-config-schema.json b/meshcentral-config-schema.json index 8ad547fe..6973592b 100644 --- a/meshcentral-config-schema.json +++ b/meshcentral-config-schema.json @@ -360,9 +360,9 @@ "type": "object", "properties": { "name": { "type": "string", "description": "Name of the alternative messaging service, for example: \"Jitsi\" " }, - "url": { "type": "string", "description": "URL to the alternative messaging services, for example: \"https://meet.jit.si/myserver-{0}\"" } + "url": { "type": "string", "description": "URL to the alternative messaging services, for example: \"https://meet.jit.si/myserver-{0}\"" }, + "localurl": { "type": "string", "description": "If specified, this is the URL that is used on the administrator side, for example: \"https://meet.jit.si/myserver-{0}\"" } }, - "additionalProperties": false, "required": [ "name", "url" ] }, "deviceMeshRouterLinks": { diff --git a/meshuser.js b/meshuser.js index eb095f7e..83e34875 100644 --- a/meshuser.js +++ b/meshuser.js @@ -540,7 +540,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use } if (matchingDomains.length > 0) { serverinfo.amtAcmFqdn = matchingDomains; } } - if ((typeof domain.altmessenging == 'object') && (typeof domain.altmessenging.name == 'string') && (typeof domain.altmessenging.url == 'string')) { serverinfo.altmessenging = [{ name: domain.altmessenging.name, url: domain.altmessenging.url }]; } + if ((typeof domain.altmessenging == 'object') && (typeof domain.altmessenging.name == 'string') && (typeof domain.altmessenging.url == 'string')) { serverinfo.altmessenging = [{ name: domain.altmessenging.name, url: domain.altmessenging.url, localurl: domain.altmessenging.localurl }]; } if (typeof domain.devicemeshrouterlinks == 'object') { serverinfo.devicemeshrouterlinks = domain.devicemeshrouterlinks; } if (Array.isArray(domain.altmessenging)) { serverinfo.altmessenging = []; for (var i in domain.altmessenging) { if ((typeof domain.altmessenging[i] == 'object') && (typeof domain.altmessenging[i].name == 'string') && (typeof domain.altmessenging[i].url == 'string')) { serverinfo.altmessenging.push({ name: domain.altmessenging[i].name, url: domain.altmessenging[i].url }); } } } serverinfo.https = true; diff --git a/views/default.handlebars b/views/default.handlebars index 81a75a94..8bfc027e 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -7409,8 +7409,10 @@ function altDeviceChat(e, i) { if (xxdialogMode) return; var url = serverinfo.altmessenging[i].url.split('{0}').join(currentNode._id.split('/').join('-')); + var localurl = url; + if (typeof serverinfo.altmessenging[i].url == 'string') { localurl = serverinfo.altmessenging[i].localurl.split('{0}').join(currentNode._id.split('/').join('-')); } meshserver.send({ action: 'msg', type: 'openUrl', nodeid: currentNode._id, url: url }); - safeNewWindow(url, 'altmessenger:' + currentNode._id, 'directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=560'); + safeNewWindow(localurl, 'altmessenger:' + currentNode._id, 'directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=560'); } function deviceToggleBackground() {