Added browser notification support to MeshMessenger

This commit is contained in:
Ylian Saint-Hilaire
2019-09-26 12:58:35 -07:00
parent 465d5345cb
commit d511e431ea
7 changed files with 53 additions and 3 deletions

View File

@@ -2847,7 +2847,6 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
var smesh = command.meshid.split('/');
if ((smesh.length != 3) || (smesh[0] != 'mesh') || (smesh[1] != domain.id)) { err = 'Invalid group id'; }
var serverName = parent.getWebServerName(domain);
if (parent.args.lanonly == true) { err = 'Server has not fixed IP or DNS name.'; }
// Handle any errors
if (err != null) {
@@ -2865,6 +2864,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
var xdomain = (domain.dns == null) ? domain.id : '';
if (xdomain != '') xdomain += "/";
var url = "http" + (args.notls ? '' : 's') + "://" + serverName + ":" + httpsPort + "/" + xdomain + "agentinvite?c=" + inviteCookie;
if (serverName.split('.') == 1) { url = "/" + xdomain + "agentinvite?c=" + inviteCookie; }
ws.send(JSON.stringify({ action: 'createInviteLink', meshid: command.meshid, url: url, expire: command.expire, cookie: inviteCookie, responseid: command.responseid, tag: command.tag }));
break;