update NSFW blur plugin with all-channel option (#325)

This commit is contained in:
creations 2025-08-05 00:15:43 -04:00 • committed by GitHub
parent f0ff31067c
commit dc6121598f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,20 +1,8 @@
/*
* Vencord, a modification for Discord's desktop app
* Copyright (c) 2022 Vendicated and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
* Vencord, a Discord client mod
* Copyright (c) 2025 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { Settings } from "@api/Settings";
import { Devs } from "@utils/constants";
@ -46,7 +34,7 @@ export default definePlugin({
find: "}renderEmbeds(",
replacement: [{
match: /\.container/,
replace: "$&+(this.props.channel.nsfw? ' vc-nsfw-img': '')"
replace: "$&+(this.props.channel.nsfw || Vencord.Settings.plugins.BlurNSFW.blurAllChannels ? ' vc-nsfw-img': '')"
}]
}
],
@ -57,6 +45,11 @@ export default definePlugin({
description: "Blur Amount (in pixels)",
default: 10,
onChange: setCss
},
blurAllChannels: {
type: OptionType.BOOLEAN,
description: "Blur attachments in all channels (not just NSFW)",
default: false
}
},