Skip to content

Commit

Permalink
Merge pull request #116 from jkhsjdhjs/fix/capabilities_on_reconnect
Browse files Browse the repository at this point in the history
Fix capabilities event listener
  • Loading branch information
tadzik authored Sep 13, 2024
2 parents 1dd2a84 + 4c6f76f commit dd825ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/116.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix auto reconnect due to event listeners not being called.
4 changes: 2 additions & 2 deletions src/irc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,12 @@ export class Client extends (EventEmitter as unknown as new () => TypedEmitter<C
if (opt.channelPrefixes) {
this.state.supportedState.channel.types = opt.channelPrefixes;
}
this.state.capabilities.once('serverCapabilitesReady', () => {
this.state.capabilities.on('serverCapabilitesReady', () => {
this.onCapsList();
// Flush on capabilities modified
this.state.flush?.();
})
this.state.capabilities.once('userCapabilitesReady', () => {
this.state.capabilities.on('userCapabilitesReady', () => {
this.onCapsConfirmed();
// Flush on capabilities modified
this.state.flush?.();
Expand Down

0 comments on commit dd825ef

Please sign in to comment.