From 9459e1758d14ba48065f7a74f6f22e2f9587a166 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Sat, 20 Feb 2016 09:41:03 -0500 Subject: [PATCH] fix moderate.js tool --- contrib/tools/api/moderate.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/tools/api/moderate.js b/contrib/tools/api/moderate.js index 66dac31..16daf5f 100644 --- a/contrib/tools/api/moderate.js +++ b/contrib/tools/api/moderate.js @@ -1,8 +1,8 @@ var http = require('http'); -var makeIpBan = function(cidr, privkey, cb) { +var makeIpBans = function(cidrs, privkey, cb) { cb({ - message: "overchan-inet-ban "+cidr; + message: cidrs.join("\noverchan-inet-ban "), name: "mod#"+privkey, frontend: "memegod.censor", newsgroup: "ctl" @@ -11,7 +11,7 @@ var makeIpBan = function(cidr, privkey, cb) { var makeDeletePosts = function(msgids, privkey, cb) { cb({ - message: "\ndelete ".join(msgids) + message: msgids.join("\ndelete "), name: "mod#"+privkey, frontend: "memegod.censor", newsgroup: "ctl", @@ -46,6 +46,6 @@ var moderate = function(req) { var privateKey = "longhexgoestripcodegoeshere"; // ban 192.168.0.1/16 and sign with private key -moderate(makeIpBan("192.168.0.1/16", privateKey)); +moderate(makeIpBans(["192.168.0.1/16"], privateKey)); // delete and and sign with private key moderate(makeDeletPosts(["", ""], privateKey));