From 97c499870c567cfa6dda271006e1201c7b2e57f4 Mon Sep 17 00:00:00 2001 From: f0x Date: Mon, 2 Dec 2024 17:20:10 +0100 Subject: [PATCH] fix channel matching logic in nick change events manual cherry-pick fix from PR #117 by jkhsjdhjs on upstream github --- src/irc.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/irc.ts b/src/irc.ts index 08486c80..6f74e9ba 100644 --- a/src/irc.ts +++ b/src/irc.ts @@ -631,9 +631,8 @@ export class Client extends (EventEmitter as unknown as new () => TypedEmitter { - 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); } @@ -714,9 +713,9 @@ export class Client extends (EventEmitter as unknown as new () => TypedEmitter