Browse Source

fix: socket.disconnect is not a function when banning a user

Owen Diffey 2 years ago
parent
commit
84ace6f513
2 changed files with 2 additions and 2 deletions
  1. 1 1
      backend/logic/actions/punishments.js
  2. 1 1
      backend/logic/actions/users.js

+ 1 - 1
backend/logic/actions/punishments.js

@@ -21,7 +21,7 @@ CacheModule.runJob("SUB", {
 
 		WSModule.runJob("SOCKETS_FROM_IP", { ip: data.ip }, this).then(sockets => {
 			sockets.forEach(socket => {
-				socket.disconnect(true);
+				socket.close();
 			});
 		});
 	}

+ 1 - 1
backend/logic/actions/users.js

@@ -131,7 +131,7 @@ CacheModule.runJob("SUB", {
 		WSModule.runJob("SOCKETS_FROM_USER", { userId: data.userId }).then(sockets => {
 			sockets.forEach(socket => {
 				socket.dispatch("keep.event:user.banned", { data: { ban: data.punishment } });
-				socket.disconnect(true);
+				socket.close();
 			});
 		});
 	}