mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-14 19:25:26 -05:00
state: simplify MONITOR reply handling
This commit is contained in:
parent
ffbbde7f28
commit
97b5970acb
1 changed files with 1 additions and 10 deletions
11
state.js
11
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 };
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue