block_cw
This commit is contained in:
@@ -30,6 +30,7 @@ const DEFAULT_CONFIG = {
|
|||||||
easter_egg: true,
|
easter_egg: true,
|
||||||
color_scheme: 'default',
|
color_scheme: 'default',
|
||||||
block_tmp: true,
|
block_tmp: true,
|
||||||
|
block_cw: ['xxg', 'zzxg'],
|
||||||
block_words_v4: ['🕷️', '[系统自动代发]'],
|
block_words_v4: ['🕷️', '[系统自动代发]'],
|
||||||
whitelist_cw: [],
|
whitelist_cw: [],
|
||||||
ipfs_gateway_list: [
|
ipfs_gateway_list: [
|
||||||
@@ -381,11 +382,23 @@ export class ConfigUI extends PureComponent {
|
|||||||
description="屏蔽所有临时帐号的发言"
|
description="屏蔽所有临时帐号的发言"
|
||||||
/>
|
/>
|
||||||
<hr />
|
<hr />
|
||||||
|
<ConfigTextArea
|
||||||
|
id="block_cw"
|
||||||
|
callback={this.save_changes_bound}
|
||||||
|
name="设置屏蔽的折叠警告"
|
||||||
|
description={
|
||||||
|
'折叠警告包含屏蔽词的树洞会不显示而非折叠,每行一个屏蔽词'
|
||||||
|
}
|
||||||
|
display={(array) => array.join('\n')}
|
||||||
|
sift={(array) => array.filter((v) => v)}
|
||||||
|
parse={(string) => string.split('\n')}
|
||||||
|
/>
|
||||||
|
<hr />
|
||||||
<ConfigTextArea
|
<ConfigTextArea
|
||||||
id="block_words_v4"
|
id="block_words_v4"
|
||||||
callback={this.save_changes_bound}
|
callback={this.save_changes_bound}
|
||||||
name="设置屏蔽词"
|
name="设置屏蔽词"
|
||||||
description={'包含屏蔽词的树洞会被折叠,每行写一个屏蔽词'}
|
description={'包含屏蔽词的树洞会不被显示,每行一个屏蔽词'}
|
||||||
display={(array) => array.join('\n')}
|
display={(array) => array.join('\n')}
|
||||||
sift={(array) => array.filter((v) => v)}
|
sift={(array) => array.filter((v) => v)}
|
||||||
parse={(string) => string.split('\n')}
|
parse={(string) => string.split('\n')}
|
||||||
|
|||||||
@@ -37,7 +37,9 @@ function check_block(info) {
|
|||||||
((window.config.block_tmp && info.is_tmp) ||
|
((window.config.block_tmp && info.is_tmp) ||
|
||||||
window.config.block_words_v4.some((word) => info.text.includes(word)) ||
|
window.config.block_words_v4.some((word) => info.text.includes(word)) ||
|
||||||
(info.cw &&
|
(info.cw &&
|
||||||
window.config.block_words_v4.some((word) => info.cw.includes(word)))) &&
|
window.config.block_words_v4
|
||||||
|
.concat(window.config.block_cw)
|
||||||
|
.some((word) => info.cw.includes(word)))) &&
|
||||||
!info.can_del
|
!info.can_del
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user