diff --git a/components/app.js b/components/app.js index 26a3fee..505223e 100644 --- a/components/app.js +++ b/components/app.js @@ -675,8 +675,7 @@ export default class App extends Component { } let members = new irc.CaseMapMap(buf.members); members.delete(msg.prefix.name); - let offline = client.cm(buf.name) === client.cm(msg.prefix.name); - buffers.set(buf.id, { ...buf, members, offline }); + buffers.set(buf.id, { ...buf, members }); affectedBuffers.push(buf.name); }); return { buffers }; diff --git a/state.js b/state.js index 613c709..b781ea3 100644 --- a/state.js +++ b/state.js @@ -419,6 +419,25 @@ export const State = { members.delete(nick); return { members }; }); + case "QUIT": + return updateUser(msg.prefix.name, (user) => { + if (!user) { + return; + } + return { offline: true }; + }); + case "NICK": + let newNick = msg.params[0]; + return updateServer((server) => { + let users = new irc.CaseMapMap(server.users); + let user = users.get(msg.prefix.name); + if (!user) { + return; + } + users.set(newNick, user); + users.delete(msg.prefix.name); + return { users }; + }); case "SETNAME": return updateUser(msg.prefix.name, { realname: msg.params[0] }); case "CHGHOST":