diff --git a/src/socket.io/groups.js b/src/socket.io/groups.js index 3b12693be0..0361560f01 100644 --- a/src/socket.io/groups.js +++ b/src/socket.io/groups.js @@ -144,6 +144,9 @@ SocketGroups.update = isOwner(function(socket, data, callback) { SocketGroups.kick = isOwner(function(socket, data, callback) { + if (socket.uid === parseInt(data.uid, 10)) { + return callback(new Error('[[error:cant-kick-self]]')); + } groups.leave(data.groupName, data.uid, callback); });