Fixed unlimited device guest sharing event.

This commit is contained in:
Ylian Saint-Hilaire 2021-11-10 09:14:55 -08:00
parent f4b9372dd2
commit 80afe74314
2 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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