v1.18.x
Julian Lam 10 years ago
parent aeafbe6170
commit 6ac04e9da7

@ -444,18 +444,24 @@ var async = require('async'),
return callback(err || new Error('[[error:no-group]]')); return callback(err || new Error('[[error:no-group]]'));
} }
db.setObject('group:' + groupName, { var values = {
userTitle: values.userTitle || '', userTitle: values.userTitle || '',
description: values.description || '', description: values.description || '',
icon: values.icon || '', icon: values.icon || '',
labelColor: values.labelColor || '#000000', labelColor: values.labelColor || '#000000',
hidden: values.hidden || '0', hidden: values.hidden || '0',
'private': values.private === false ? '0' : '1' 'private': values.private === false ? '0' : '1'
}, function(err) { };
db.setObject('group:' + groupName, values, function(err) {
if (err) { if (err) {
return callback(err); return callback(err);
} }
plugins.fireHook('action:group.updated', {
name: 'group:' + groupName,
values: values
});
renameGroup(groupName, values.name, callback); renameGroup(groupName, values.name, callback);
}); });
}); });
@ -511,6 +517,14 @@ var async = require('async'),
}, },
function(next) { function(next) {
renameGroupMember('groups', oldName, newName, next); renameGroupMember('groups', oldName, newName, next);
},
function(next) {
plugins.fireHook('action:group.rename', {
old: oldName,
new: newName
});
next();
} }
], callback); ], callback);
}); });

Loading…
Cancel
Save