Added altmessaging localurl option, #3575

This commit is contained in:
Ylian Saint-Hilaire 2022-02-01 11:29:56 -08:00
parent ac2bf066c3
commit 4dcf4857c4
3 changed files with 6 additions and 4 deletions

View File

@ -360,9 +360,9 @@
"type": "object", "type": "object",
"properties": { "properties": {
"name": { "type": "string", "description": "Name of the alternative messaging service, for example: \"Jitsi\" " }, "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" ] "required": [ "name", "url" ]
}, },
"deviceMeshRouterLinks": { "deviceMeshRouterLinks": {

View File

@ -540,7 +540,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
} }
if (matchingDomains.length > 0) { serverinfo.amtAcmFqdn = matchingDomains; } 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 (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 }); } } } 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; serverinfo.https = true;

View File

@ -7409,8 +7409,10 @@
function altDeviceChat(e, i) { function altDeviceChat(e, i) {
if (xxdialogMode) return; if (xxdialogMode) return;
var url = serverinfo.altmessenging[i].url.split('{0}').join(currentNode._id.split('/').join('-')); 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 }); 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() { function deviceToggleBackground() {