Skip to content

Commit

Permalink
fix channel matching logic in nick change events
Browse files Browse the repository at this point in the history
manual cherry-pick fix from PR matrix-org#117 by jkhsjdhjs on upstream github
  • Loading branch information
f0x52 committed Dec 2, 2024
1 parent f37dda3 commit 97c4998
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/irc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -631,9 +631,8 @@ export class Client extends (EventEmitter as unknown as new () => TypedEmitter<C

// finding what channels a user is in
this.state.chans.forEach((nickChannel, channame) => {
const chanUser = message.nick && nickChannel.users.get(message.nick);
if (message.nick && chanUser) {
nickChannel.users.set(message.args[0], chanUser);
if (message.nick && nickChannel.users.has(message.nick)) {
nickChannel.users.set(message.args[0], nickChannel.users.get(message.nick)!);
nickChannel.users.delete(message.nick);
channelsForNick.push(channame);
}
Expand Down Expand Up @@ -714,9 +713,9 @@ export class Client extends (EventEmitter as unknown as new () => TypedEmitter<C
channel.users.set(user, modes);
});
newNames.clear();

this.state.flush?.();

this.emit('names', message.args[1], channel.users);
this._send('MODE', message.args[1]);
}
Expand Down

0 comments on commit 97c4998

Please sign in to comment.