Add support for account-notify

This commit is contained in:
Simon Ser 2021-09-21 14:49:32 +02:00
parent 8e631f97ef
commit d12e1109b3
3 changed files with 9 additions and 0 deletions

View File

@ -798,6 +798,8 @@ export default class App extends Component {
case irc.RPL_MONOFFLINE: case irc.RPL_MONOFFLINE:
case "AWAY": case "AWAY":
case "SETNAME": case "SETNAME":
case "CHGHOST":
case "ACCOUNT":
case "CAP": case "CAP":
case "AUTHENTICATE": case "AUTHENTICATE":
case "PING": case "PING":

View File

@ -3,6 +3,7 @@ import * as irc from "./irc.js";
// Static list of capabilities that are always requested when supported by the // Static list of capabilities that are always requested when supported by the
// server // server
const permanentCaps = [ const permanentCaps = [
"account-notify",
"away-notify", "away-notify",
"batch", "batch",
"chghost", "chghost",

View File

@ -464,6 +464,12 @@ export const State = {
username: msg.params[0], username: msg.params[0],
hostname: msg.params[1], hostname: msg.params[1],
}); });
case "ACCOUNT":
let account = msg.params[0];
if (account === "*") {
account = null;
}
return updateUser(msg.prefix.name, { account });
case "AWAY": case "AWAY":
let awayMessage = msg.params[0]; let awayMessage = msg.params[0];
return updateUser(msg.prefix.name, { away: !!awayMessage }); return updateUser(msg.prefix.name, { away: !!awayMessage });