From c7169a53e4378a8f20245961de37a3647a3b871f Mon Sep 17 00:00:00 2001
From: echicken <echicken@bbs.electronicchicken.com>
Date: Fri, 26 Feb 2021 14:15:56 -0500
Subject: [PATCH] scan_threads doesn't need offset or page size

---
 webv4/lib/events/forum.js | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/webv4/lib/events/forum.js b/webv4/lib/events/forum.js
index c7719bf32f..defa066d31 100644
--- a/webv4/lib/events/forum.js
+++ b/webv4/lib/events/forum.js
@@ -21,7 +21,13 @@ function shallow_diff(a, b) {
 }
 
 function forum_emit(evt, data) {
-    emit({ event: 'forum', data: JSON.stringify({ type: evt, data: data }) });
+    emit({
+        event: 'forum',
+        data: JSON.stringify({
+            type: evt,
+            data: data
+        })
+    });
 }
 
 function scan_groups() {
@@ -46,8 +52,8 @@ function scan_subs(group) {
     last_subs = scan;
 }
 
-function scan_threads(sub, offset, page_size) {
-    const scan = getThreadStats(sub, offset, page_size, !is_real_user);
+function scan_threads(sub) {
+    const scan = getThreadStats(sub, !is_real_user);
     if (!last_threads) {
         forum_emit('threads', scan);
     } else {
@@ -71,7 +77,7 @@ function cycle() {
     last_run = time();
     if (is_real_user && Request.has_param('groups_unread')) scan_groups();
     if (is_real_user && Request.has_param('subs_unread')) scan_subs(Request.get_param('subs_unread'));
-    if (Request.has_param('threads')) scan_threads(Request.get_param('threads'), Request.get_param('offset'), Request.get_param('page_size'));
+    if (Request.has_param('sub')) scan_threads(Request.get_param('sub'));
 }
 
 this;
-- 
GitLab