Allow group name change (#795)

* fix bug on email separator

Signed-off-by: Denis barbaron <denis.barbaron@orange.com>

* allow group name change

Signed-off-by: Denis barbaron <denis.barbaron@orange.com>

---------

Signed-off-by: Denis barbaron <denis.barbaron@orange.com>
This commit is contained in:
Denis Barbaron
2024-07-15 17:03:33 +02:00
committed by GitHub
parent 875730886d
commit cf56911e9f
8 changed files with 99 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
/**
* Copyright © 2019 contains code contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0
* Copyright © 2019-2024 contains code contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0
**/
var http = require('http')
@@ -133,6 +133,15 @@ module.exports = function(options) {
disconnectSocket(true)
})
.on(wire.DeviceChangeMessage, function(channel, message) {
if (user.groups.subscribed.indexOf(message.device.group.id) > -1) {
socket.emit('device.change', {
important: true
, data: {
serial: message.device.serial
, group: message.device.group
}
})
}
if (user.groups.subscribed.indexOf(message.device.group.origin) > -1 ||
user.groups.subscribed.indexOf(message.oldOriginGroupId) > -1) {
socket.emit('user.settings.devices.' + message.action, message)