Skip to content

Fix chanlist in nick change events #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/117.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix nick changes not being bridged to matrix.
5 changes: 2 additions & 3 deletions src/irc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -630,9 +630,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) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if-statement checks if chanUser is truthy, and an empty string is not.
So nick change events don't get past this check, if the user has no channel modes set (normal user).
The event still fires in matrix-appservice-irc, but with a channel list that's always empty, so nothing happens.

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
Loading