From 80afe74314533ae545af1e4d8acce8223d8326d1 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Wed, 10 Nov 2021 09:14:55 -0800 Subject: [PATCH] Fixed unlimited device guest sharing event. --- meshuser.js | 7 ++++++- views/default.handlebars | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/meshuser.js b/meshuser.js index 5b264154..bb6d0748 100644 --- a/meshuser.js +++ b/meshuser.js @@ -4809,7 +4809,12 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use // Send out an event that we added a device share var targets = parent.CreateNodeDispatchTargets(node.meshid, node._id, ['server-users', user._id]); - var event = { etype: 'node', userid: user._id, username: user.name, nodeid: node._id, action: 'addedDeviceShare', msg: 'Added Device Share', msgid: 101, msgArgs: [command.guestname, 'DATETIME:' + startTime, 'DATETIME:' + expireTime], domain: domain.id }; + var event; + if ((startTime != null) && (expireTime != null)) { + event = { etype: 'node', userid: user._id, username: user.name, nodeid: node._id, action: 'addedDeviceShare', msg: 'Added device share: ' + command.guestname + '.', msgid: 101, msgArgs: [command.guestname, 'DATETIME:' + startTime, 'DATETIME:' + expireTime], domain: domain.id }; + } else { + event = { etype: 'node', userid: user._id, username: user.name, nodeid: node._id, action: 'addedDeviceShare', msg: 'Added device share ' + command.guestname + ' with unlimited time.', msgid: 131, msgArgs: [command.guestname], domain: domain.id }; + } parent.parent.DispatchEvent(targets, obj, event); // Send device share update diff --git a/views/default.handlebars b/views/default.handlebars index b92bee29..a83f5a88 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -13105,7 +13105,8 @@ 127: "Changed account display name to {0}.", 128: "Account created, name is {0}.", 129: "Removed account display name.", - 130: "User notifications changed" + 130: "User notifications changed", + 131: "Added device share {0} with unlimited time." }; // Highlights the device being hovered