mirror of
https://codeberg.org/teddit/teddit.git
synced 2026-04-18 21:45:06 -04:00
add nsfw warning pages to posts when nsfw content is disabled
This commit is contained in:
@@ -27,6 +27,11 @@ module.exports = function() {
|
||||
let images = null
|
||||
let is_self_link = false
|
||||
let valid_reddit_self_domains = ['reddit.com']
|
||||
|
||||
|
||||
if(data.over_18)
|
||||
if((config.nsfw_enabled === false && user_preferences.nsfw_enabled != 'true') || user_preferences.nsfw_enabled === 'false')
|
||||
continue
|
||||
|
||||
if(data.domain) {
|
||||
let tld = data.domain.split('self.')
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
module.exports = function() {
|
||||
const config = require('../config');
|
||||
this.processJsonUser = function(json, parsed, after, before, user_preferences) {
|
||||
return new Promise(resolve => {
|
||||
(async () => {
|
||||
@@ -39,6 +40,10 @@ module.exports = function() {
|
||||
|
||||
let post_id = post.permalink.split('/').slice(-2)[0] + '/'
|
||||
let url = post.permalink.replace(post_id, '')
|
||||
|
||||
if(post.over_18)
|
||||
if((config.nsfw_enabled === false && user_preferences.nsfw_enabled != 'true') || user_preferences.nsfw_enabled === 'false')
|
||||
continue
|
||||
|
||||
if(type === 't3') {
|
||||
let duration = null
|
||||
|
||||
Reference in New Issue
Block a user