From 70c8cdcc75d20dcef5649e18580b49c8cf9ccb8c Mon Sep 17 00:00:00 2001
From: echicken <echicken@bbs.electronicchicken.com>
Date: Thu, 8 Oct 2020 00:31:53 -0400
Subject: [PATCH] Added block-sender call

---
 webv4/root/api/forum.ssjs | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/webv4/root/api/forum.ssjs b/webv4/root/api/forum.ssjs
index 8835437a2f..2a660f299b 100644
--- a/webv4/root/api/forum.ssjs
+++ b/webv4/root/api/forum.ssjs
@@ -12,9 +12,7 @@ load(settings.web_lib + 'forum.js');
 var reply = {};
 
 // There must be an API call, and the user must not be a guest or unknown
-if ((http_request.method === 'GET' || http_request.method === 'POST') &&
-    typeof http_request.query.call !== 'undefined'
-) {
+if (http_request.query.call !== undefined && (http_request.method === 'GET' || http_request.method === 'POST')) {
 
     var handled = false;
 
@@ -152,6 +150,14 @@ if ((http_request.method === 'GET' || http_request.method === 'POST') &&
                 }
                 break;
 
+            case 'block-sender':
+                if (user.is_sysop) {
+                    if (http_request.query.from) addTwit(decodeURIComponent(http_request.query.from[0]));
+                    if (http_request.query.from_net) addTwit(decodeURIComponent(http_request.query.from_net[0]));
+                    reply.err = null;
+                }
+                break;
+
             default:
                 handled = false;
                 break;
-- 
GitLab