diff --git a/client/index.html b/client/index.html index 362688ba..1b40bfce 100644 --- a/client/index.html +++ b/client/index.html @@ -554,6 +554,16 @@ +
/ban nick
+ Ban (+b
) a user from the current channel.
+ This can be a nickname or a hostmask.
/banlist
@@ -799,6 +809,16 @@
/unban nick
+ Unban (-b
) a user from the current channel.
/voice nick [...nick]
diff --git a/client/js/constants.js b/client/js/constants.js
index 546637fd..c9587709 100644
--- a/client/js/constants.js
+++ b/client/js/constants.js
@@ -3,6 +3,7 @@
const commands = [
"/away",
"/back",
+ "/ban",
"/banlist",
"/close",
"/connect",
@@ -28,6 +29,7 @@ const commands = [
"/server",
"/slap",
"/topic",
+ "/unban",
"/voice",
"/whois"
];
diff --git a/src/client.js b/src/client.js
index 0d3caffa..aa3b7045 100644
--- a/src/client.js
+++ b/src/client.js
@@ -36,6 +36,7 @@ var events = [
"whois"
];
var inputs = [
+ "ban",
"ctcp",
"msg",
"part",
diff --git a/src/plugins/inputs/ban.js b/src/plugins/inputs/ban.js
new file mode 100644
index 00000000..b6745652
--- /dev/null
+++ b/src/plugins/inputs/ban.js
@@ -0,0 +1,44 @@
+"use strict";
+
+var Chan = require("../../models/chan");
+var Msg = require("../../models/msg");
+
+exports.commands = [
+ "ban",
+ "unban",
+ "banlist"
+];
+
+exports.input = function(network, chan, cmd, args) {
+ if (chan.type !== Chan.Type.CHANNEL) {
+ chan.pushMessage(this, new Msg({
+ type: Msg.Type.ERROR,
+ text: `${cmd} command can only be used in channels.`
+ }));
+
+ return;
+ }
+
+ if (cmd !== "banlist" && args.length === 0) {
+ if (args.length === 0) {
+ chan.pushMessage(this, new Msg({
+ type: Msg.Type.ERROR,
+ text: `Usage: /${cmd}