More user groups improvements.

This commit is contained in:
Ylian Saint-Hilaire 2020-01-06 11:54:32 -08:00
parent fce364d2ea
commit fe1079d1f1
3 changed files with 10 additions and 2 deletions

View File

@ -53,7 +53,7 @@ var MeshServerCreateControl = function (domain, authCookie) {
obj.send = function (x) {
if (obj.socket != null && obj.connectstate == 1) {
if (obj.trace) { console.log('SEND', x); }
if (obj.trace && (x.action != 'ping')) { console.log('SEND', x); }
obj.socket.send(JSON.stringify(x));
}
}

View File

@ -915,6 +915,10 @@
ugroup.links = message.event.links;
}
//masterUpdate(8192 + 16384);
// Group update, refresh all our device groups and nodes. TODO: Optimize this to only do this when needed.
meshserver.send({ action: 'meshes' });
meshserver.send({ action: 'nodes' });
break;
}
case 'deleteusergroup': {
@ -954,7 +958,7 @@
meshes[message.event.meshid].links = message.event.links;
// Check if we lost rights to this mesh in this change.
if (meshes[message.event.meshid].links[userinfo._id] == null) {
if (IsMeshViewable(message.event.meshid) == false) {
if ((xxcurrentView == 20) && (currentMesh == meshes[message.event.meshid])) go(2);
delete meshes[message.event.meshid];

View File

@ -2238,6 +2238,10 @@
if (message.event.links) { ugroup.links = message.event.links; } else { delete ugroup.links; }
}
masterUpdate(8192 + 16384);
// Group update, refresh all our device groups and nodes. TODO: Optimize this to only do this when needed.
meshserver.send({ action: 'meshes' });
meshserver.send({ action: 'nodes' });
break;
}
case 'deleteusergroup': {