hackchat-engine 1.1.14 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.js +11 -0
- package/package.json +1 -1
- package/util/Constants.js +1 -0
- package/websocket/SocketHandler.js +3 -3
package/Client.js
CHANGED
|
@@ -442,6 +442,17 @@ class Client extends EventEmitter {
|
|
|
442
442
|
|
|
443
443
|
this.ws.send(payload);
|
|
444
444
|
}
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* Unsubscribe from a channel
|
|
448
|
+
* @param {string} channel The channel to leave
|
|
449
|
+
*/
|
|
450
|
+
leave(channel) {
|
|
451
|
+
this.ws.send({
|
|
452
|
+
cmd: OPCodes.LEAVE,
|
|
453
|
+
channel: channel || this.channel, // @todo Multichannel
|
|
454
|
+
});
|
|
455
|
+
}
|
|
445
456
|
}
|
|
446
457
|
|
|
447
458
|
export default Client;
|
package/package.json
CHANGED
package/util/Constants.js
CHANGED
|
@@ -85,9 +85,9 @@ class SocketHandler extends EventEmitter {
|
|
|
85
85
|
/**
|
|
86
86
|
* Store new client session id when assigned
|
|
87
87
|
*/
|
|
88
|
-
this.client.on(Events.SESSION, (data) =>
|
|
89
|
-
this.sessionID = data.token
|
|
90
|
-
);
|
|
88
|
+
this.client.on(Events.SESSION, (data) => {
|
|
89
|
+
this.sessionID = data.token;
|
|
90
|
+
});
|
|
91
91
|
|
|
92
92
|
// Initiate connection
|
|
93
93
|
this.connect(gateway);
|