diff --git a/lib/client.js b/lib/client.js index 416b513..89d9ed4 100644 --- a/lib/client.js +++ b/lib/client.js @@ -303,6 +303,13 @@ export default class Client extends EventTarget { case irc.RPL_ENDOFWHOIS: this.endPendingList("WHOIS " + msg.params[1], msg); break; + case irc.RPL_WHOREPLY: + case irc.RPL_WHOSPCRPL: + this.pushPendingList("WHO", msg); + break; + case irc.RPL_ENDOFWHO: + this.endPendingList("WHO", msg); + break; case irc.ERR_NICKLOCKED: case irc.ERR_SASLFAIL: case irc.ERR_SASLTOOLONG: diff --git a/state.js b/state.js index 008bd8f..04e4eea 100644 --- a/state.js +++ b/state.js @@ -384,14 +384,9 @@ export const State = { return updateUser(who.nick, who); case irc.RPL_ENDOFWHO: target = msg.params[1]; - if (!client.isChannel(target) && target.indexOf("*") < 0) { + if (msg.list.length == 0 && !client.isChannel(target) && target.indexOf("*") < 0) { // Not a channel nor a mask, likely a nick return updateUser(target, (user) => { - // TODO: mark user offline if we have old WHO info but this - // WHO reply is empty - if (user) { - return; - } return { offline: true }; }); }