From 4249da4ba8b09575cbe745480b4ee7191fc3c9cb Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 11 Jun 2021 00:27:19 +0200 Subject: [PATCH] Add /quiet and /unquiet --- commands.js | 21 +++++++++++++++++++++ components/app.js | 2 ++ lib/irc.js | 3 +++ 3 files changed, 26 insertions(+) diff --git a/commands.js b/commands.js index b6d52e4..c23270f 100644 --- a/commands.js +++ b/commands.js @@ -272,6 +272,20 @@ export default { app.open(nick); }, }, + "quiet": { + usage: "[nick]", + description: "Quiet a user in the channel, or display the current quiet list", + execute: (app, args) => { + if (args.length == 0) { + getActiveClient(app).send({ + command: "MODE", + params: [getActiveChannel(app), "+q"], + }); + } else { + return setUserHostMode(app, args, "+q"); + } + }, + }, "quit": { description: "Quit", execute: (app, args) => { @@ -344,6 +358,13 @@ export default { return setUserHostMode(app, args, "-b"); }, }, + "unquiet": { + usage: "", + description: "Remove a user from the quiet list", + execute: (app, args) => { + return setUserHostMode(app, args, "-q"); + }, + }, "voice": { usage: "", description: "Give a user voiced status on this channel", diff --git a/components/app.js b/components/app.js index 8cacbfd..abf9a71 100644 --- a/components/app.js +++ b/components/app.js @@ -726,6 +726,8 @@ export default class App extends Component { case irc.RPL_ENDOFEXCEPTLIST: case irc.RPL_BANLIST: case irc.RPL_ENDOFBANLIST: + case irc.RPL_QUIETLIST: + case irc.RPL_ENDOFQUIETLIST: channel = msg.params[1]; this.addMessage(serverID, channel, msg); break; diff --git a/lib/irc.js b/lib/irc.js index 044fe81..e56fef2 100644 --- a/lib/irc.js +++ b/lib/irc.js @@ -38,6 +38,9 @@ export const ERR_PASSWDMISMATCH = "464"; export const ERR_YOUREBANNEDCREEP = "465"; // RFC 2812 export const ERR_UNAVAILRESOURCE = "437"; +// Other +export const RPL_QUIETLIST = "728"; +export const RPL_ENDOFQUIETLIST = "729"; // IRCv3 SASL: https://ircv3.net/specs/extensions/sasl-3.1 export const RPL_LOGGEDIN = "900"; export const RPL_LOGGEDOUT = "901";