state: add account to server

This commit is contained in:
Simon Ser 2021-11-21 12:13:44 +01:00
parent 51bf8da3d6
commit 0af40a1a8e

View file

@ -255,6 +255,7 @@ export const State = {
status: ServerStatus.DISCONNECTED, status: ServerStatus.DISCONNECTED,
isupport: new Map(), isupport: new Map(),
users: new irc.CaseMapMap(null, irc.CaseMapping.RFC1459), users: new irc.CaseMapMap(null, irc.CaseMapping.RFC1459),
account: null,
}); });
return [id, { servers }]; return [id, { servers }];
}, },
@ -345,6 +346,10 @@ export const State = {
}; };
}), }),
}; };
case irc.RPL_LOGGEDIN:
return updateServer({ account: msg.params[2] });
case irc.RPL_LOGGEDOUT:
return updateServer({ account: null });
case irc.RPL_NOTOPIC: case irc.RPL_NOTOPIC:
channel = msg.params[1]; channel = msg.params[1];
return updateBuffer(channel, { topic: null }); return updateBuffer(channel, { topic: null });