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