aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-08-25 13:09:14 +0200
committerSimon Ser <contact@emersion.fr>2023-08-25 13:09:14 +0200
commit97b5970acbcd9b36c683c14b7866849856a6b7d9 (patch)
tree881fa719db727c90696fca8c0e982cc6ac5523b5
parentffbbde7f2838337e76cdccc7660070391f8fbb28 (diff)
downloadgamja-97b5970acbcd9b36c683c14b7866849856a6b7d9.tar.gz
gamja-97b5970acbcd9b36c683c14b7866849856a6b7d9.zip
state: simplify MONITOR reply handling
-rw-r--r--state.js11
1 files changed, 1 insertions, 10 deletions
diff --git a/state.js b/state.js
index 1c1bc5a..578b91b 100644
--- a/state.js
+++ b/state.js
@@ -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 };
}