diff --git a/bubble-server/src/main/java/bubble/rule/bblock/BubbleBlockConfig.java b/bubble-server/src/main/java/bubble/rule/bblock/BubbleBlockConfig.java index 4a3588d8..1d46ae38 100644 --- a/bubble-server/src/main/java/bubble/rule/bblock/BubbleBlockConfig.java +++ b/bubble-server/src/main/java/bubble/rule/bblock/BubbleBlockConfig.java @@ -12,6 +12,9 @@ import java.util.List; @NoArgsConstructor @Slf4j public class BubbleBlockConfig { + @Getter @Setter private Boolean inPageBlocks; + public boolean inPageBlocks() { return inPageBlocks != null && inPageBlocks; } + @Getter @Setter private BubbleBlockList[] blockLists; public BubbleBlockConfig updateList(BubbleBlockList list) { diff --git a/bubble-server/src/main/java/bubble/rule/bblock/BubbleBlockRuleDriver.java b/bubble-server/src/main/java/bubble/rule/bblock/BubbleBlockRuleDriver.java index 8fd5bde4..a777a8a1 100644 --- a/bubble-server/src/main/java/bubble/rule/bblock/BubbleBlockRuleDriver.java +++ b/bubble-server/src/main/java/bubble/rule/bblock/BubbleBlockRuleDriver.java @@ -116,12 +116,16 @@ public class BubbleBlockRuleDriver extends TrafficAnalyticsRuleDriver { return FilterMatchDecision.no_match; case filter: - if (log.isInfoEnabled()) log.info(prefix+"decision is FILTER"); final List specs = decision.getSpecs(); if (empty(specs)) { log.warn(prefix+"decision was 'filter' but no specs were found, returning no_match"); return FilterMatchDecision.no_match; } else { + if (!bubbleBlockConfig.inPageBlocks()) { + log.info(prefix+"decision was FILTER but inPageBlocks are disabled (returning no_match)"); + return FilterMatchDecision.no_match; + } + if (log.isInfoEnabled()) log.info(prefix+"decision is FILTER (returning match)"); return FilterMatchDecision.match; } } diff --git a/bubble-server/src/main/resources/bubble/rule/social/block/site/Reason.js.hbs b/bubble-server/src/main/resources/bubble/rule/social/block/site/Reason.js.hbs index 52153a4e..1197377f 100644 --- a/bubble-server/src/main/resources/bubble/rule/social/block/site/Reason.js.hbs +++ b/bubble-server/src/main/resources/bubble/rule/social/block/site/Reason.js.hbs @@ -4,7 +4,7 @@ function {{JS_PREFIX}}_apply_blocks(blocked_users) { console.warn('No comments found, not filtering'); return; } - {{JS_PREFIX}}_consider_block(comments.querySelector('li.comment'), blocked_users); + {{JS_PREFIX}}_consider_block(comments.querySelectorAll('li.comment'), blocked_users); } function {{JS_PREFIX}}_consider_block(comments, blocked_users) {