Store WHO list in RPL_ENDOFWHO

This allows the state-tracker to figure out whether a WHO query
returned no result.
This commit is contained in:
Simon Ser
2021-11-10 10:32:23 +01:00
parent c11bf6508a
commit 55361c5a2b
2 changed files with 8 additions and 6 deletions

View File

@@ -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 };
});
}