Skip to content

Node.js based forum software built for the modern web

closes #3952

barisusakli270f8130daba
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);
});