diff options
author | Simon Ser <contact@emersion.fr> | 2023-08-25 13:09:14 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-08-25 13:09:14 +0200 |
commit | 97b5970acbcd9b36c683c14b7866849856a6b7d9 (patch) | |
tree | 881fa719db727c90696fca8c0e982cc6ac5523b5 | |
parent | ffbbde7f2838337e76cdccc7660070391f8fbb28 (diff) | |
download | gamja-97b5970acbcd9b36c683c14b7866849856a6b7d9.tar.gz gamja-97b5970acbcd9b36c683c14b7866849856a6b7d9.zip |
state: simplify MONITOR reply handling
-rw-r--r-- | state.js | 11 |
1 files changed, 1 insertions, 10 deletions
@@ -645,21 +645,12 @@ export const State = { return { members }; }); case irc.RPL_MONONLINE: - targets = msg.params[1].split(","); - - for (let target of targets) { - let prefix = irc.parsePrefix(target); - let update = updateUser(prefix.name, { offline: false }); - state = { ...state, ...update }; - } - - return state; case irc.RPL_MONOFFLINE: targets = msg.params[1].split(","); for (let target of targets) { let prefix = irc.parsePrefix(target); - let update = updateUser(prefix.name, { offline: true }); + let update = updateUser(prefix.name, { offline: msg.command == irc.RPL_MONOFFLINE }); state = { ...state, ...update }; } |