mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-28 18:45:51 -05:00
Update user on QUIT and NICK
This commit is contained in:
parent
c66ce61029
commit
ecb2ee041b
2 changed files with 20 additions and 2 deletions
|
@ -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 };
|
||||
|
|
19
state.js
19
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":
|
||||
|
|
Loading…
Reference in a new issue