可屏蔽临时帐号
This commit is contained in:
@@ -29,7 +29,8 @@ const DEFAULT_CONFIG = {
|
|||||||
pressure: false,
|
pressure: false,
|
||||||
easter_egg: true,
|
easter_egg: true,
|
||||||
color_scheme: 'default',
|
color_scheme: 'default',
|
||||||
block_words_v3: ['蜘蛛'],
|
block_tmp: false,
|
||||||
|
block_words_v3: ['🕷️'],
|
||||||
whitelist_cw: [],
|
whitelist_cw: [],
|
||||||
ipfs_gateway_list: [
|
ipfs_gateway_list: [
|
||||||
'https://<hash>.ipfs.dweb.link/',
|
'https://<hash>.ipfs.dweb.link/',
|
||||||
@@ -373,10 +374,13 @@ export class ConfigUI extends PureComponent {
|
|||||||
callback={this.save_changes_bound}
|
callback={this.save_changes_bound}
|
||||||
/>
|
/>
|
||||||
<hr />
|
<hr />
|
||||||
{/* <ConfigBlockWords
|
<ConfigSwitch
|
||||||
id="block-words"
|
|
||||||
callback={this.save_changes_bound}
|
callback={this.save_changes_bound}
|
||||||
/> */}
|
id="block_tmp"
|
||||||
|
name="屏蔽临时帐号"
|
||||||
|
description="屏蔽所有临时帐号的发言"
|
||||||
|
/>
|
||||||
|
<hr />
|
||||||
<ConfigTextArea
|
<ConfigTextArea
|
||||||
id="block_words_v3"
|
id="block_words_v3"
|
||||||
callback={this.save_changes_bound}
|
callback={this.save_changes_bound}
|
||||||
|
|||||||
17
src/Flows.js
17
src/Flows.js
@@ -32,6 +32,14 @@ window.LATEST_POST_ID = parseInt(localStorage['_LATEST_POST_ID'], 10) || 0;
|
|||||||
|
|
||||||
const DZ_NAME = '洞主';
|
const DZ_NAME = '洞主';
|
||||||
|
|
||||||
|
function check_block(info) {
|
||||||
|
return (
|
||||||
|
((window.config.block_tmp && info.is_tmp) ||
|
||||||
|
window.config.block_words_v3.some((word) => info.text.includes(word))) &&
|
||||||
|
!info.can_del
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function load_single_meta(show_sidebar, token) {
|
function load_single_meta(show_sidebar, token) {
|
||||||
return async (pid, replace = false) => {
|
return async (pid, replace = false) => {
|
||||||
let color_picker = new ColorPicker();
|
let color_picker = new ColorPicker();
|
||||||
@@ -100,9 +108,7 @@ class Reply extends PureComponent {
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
const author = info.name,
|
const author = info.name,
|
||||||
replyText = info.text,
|
replyText = info.text,
|
||||||
has_block_words =
|
has_block_words = check_block(info);
|
||||||
window.config.block_words_v3.some((word) => info.text.includes(word)) &&
|
|
||||||
!info.can_del;
|
|
||||||
this.color_picker = new ColorPicker();
|
this.color_picker = new ColorPicker();
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -851,10 +857,7 @@ class FlowItemRow extends PureComponent {
|
|||||||
window.config.whitelist_cw.indexOf('*') == -1 &&
|
window.config.whitelist_cw.indexOf('*') == -1 &&
|
||||||
window.config.whitelist_cw.indexOf(props.info.cw) == -1 &&
|
window.config.whitelist_cw.indexOf(props.info.cw) == -1 &&
|
||||||
props.mode === 'list';
|
props.mode === 'list';
|
||||||
this.has_block_words =
|
this.has_block_words = check_block(props.info);
|
||||||
window.config.block_words_v3.some((word) =>
|
|
||||||
props.info.text.includes(word),
|
|
||||||
) && !props.info.can_del;
|
|
||||||
this.color_picker = new ColorPicker();
|
this.color_picker = new ColorPicker();
|
||||||
this.state = {
|
this.state = {
|
||||||
replies: props.info.comments
|
replies: props.info.comments
|
||||||
|
|||||||
Reference in New Issue
Block a user