From 1aacef0b522c601a45e6cd3e9698cf0e184ffd39 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Fri, 8 Oct 2021 19:03:51 -0700 Subject: [PATCH] MeshCtrl.js devicesharing improvements. --- meshctrl.js | 10 +++++++++- meshuser.js | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/meshctrl.js b/meshctrl.js index 1cec5e42..7d027e3c 100644 --- a/meshctrl.js +++ b/meshctrl.js @@ -1870,7 +1870,6 @@ function serverConnect() { case 'addusertousergroup': case 'removeuserfromusergroup': case 'removeDeviceShare': - case 'createDeviceShareLink': case 'userbroadcast': { // BROADCAST if ((settings.cmd == 'shell') || (settings.cmd == 'upload') || (settings.cmd == 'download')) return; if ((settings.multiresponse != null) && (settings.multiresponse > 1)) { settings.multiresponse--; break; } @@ -1882,6 +1881,15 @@ function serverConnect() { } break; } + case 'createDeviceShareLink': + if (data.result == 'OK') { + if (data.publicid) { console.log('ID: ' + data.publicid); } + console.log('URL: ' + data.url); + } else { + console.log(data.result); + } + process.exit(); + break; case 'createInviteLink': if (data.responseid == 'meshctrl') { if (data.url) { console.log(data.url); } diff --git a/meshuser.js b/meshuser.js index d2a2fa19..cbdf912a 100644 --- a/meshuser.js +++ b/meshuser.js @@ -4718,6 +4718,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use var url = 'https://' + serverName + ':' + httpsPort + '/' + xdomain + 'sharing?c=' + inviteCookie; if (serverName.split('.') == 1) { url = '/' + xdomain + page + '?c=' + inviteCookie; } command.url = url; + command.publicid = publicid; if (command.responseid != null) { command.result = 'OK'; } try { ws.send(JSON.stringify(command)); } catch (ex) { }