This commit is contained in:
Ylian Saint-Hilaire 2021-04-20 20:38:10 -07:00
parent 652001ef7b
commit 36d9d13234
2 changed files with 2 additions and 2 deletions

View File

@ -2491,7 +2491,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
if ((typeof command.consent == 'number') && (command.consent != group.consent)) { if (change != '') change += ' and consent changed'; else change += 'User group "' + group.name + '" consent changed'; group.consent = command.consent; }
if (change != '') {
db.Set(group);
var event = { etype: 'ugrp', userid: user._id, username: user.name, ugrpid: group._id, name: group.name, desc: group.desc, consent: group.consent, action: 'usergroupchange', links: group.links, msg: change, domain: domain.id };
var event = { etype: 'ugrp', userid: user._id, username: user.name, ugrpid: group._id, name: group.name, desc: group.desc, consent: ((group.consent == null) ? 0 : group.consent), action: 'usergroupchange', links: group.links, msg: change, domain: domain.id };
if (db.changeStream) { event.noact = 1; } // If DB change stream is active, don't use this event to change the mesh. Another event will come.
parent.parent.DispatchEvent(['*', group._id, user._id], obj, event);
}

View File

@ -2762,7 +2762,7 @@
ugroup.name = message.event.name;
if (message.event.desc) { ugroup.desc = message.event.desc; } else { delete ugroup.desc; }
if (message.event.links) { ugroup.links = message.event.links; } else { delete ugroup.links; }
if (message.event.consent) { ugroup.consent = message.event.consent; } else { delete ugroup.consent; }
if (message.event.consent !== null) { ugroup.consent = message.event.consent; }
}
mainUpdate(4096 + 8192 + 16384);