Remove unnecessary client.sockets ref

This commit is contained in:
Pavel Djundik 2019-12-18 11:22:11 +02:00
parent 6091514630
commit 0d7b980f90

View File

@ -54,7 +54,6 @@ function Client(manager, name, config = {}) {
idMsg: 1, idMsg: 1,
name: name, name: name,
networks: [], networks: [],
sockets: manager.sockets,
manager: manager, manager: manager,
messageStorage: [], messageStorage: [],
highlightRegex: null, highlightRegex: null,
@ -145,8 +144,8 @@ Client.prototype.createChannel = function(attr) {
}; };
Client.prototype.emit = function(event, data) { Client.prototype.emit = function(event, data) {
if (this.sockets !== null) { if (this.manager !== null) {
this.sockets.in(this.id).emit(event, data); this.manager.sockets.in(this.id).emit(event, data);
} }
}; };
@ -574,7 +573,7 @@ Client.prototype.names = function(data) {
}; };
Client.prototype.quit = function(signOut) { Client.prototype.quit = function(signOut) {
const sockets = this.sockets.sockets; const sockets = this.manager.sockets.sockets;
const room = sockets.adapter.rooms[this.id]; const room = sockets.adapter.rooms[this.id];
if (room && room.sockets) { if (room && room.sockets) {