replace reddit links by default
This commit is contained in:
parent
e209391665
commit
fa5e3337c7
|
@ -164,9 +164,6 @@ module.exports = function(request, fs) {
|
|||
}
|
||||
|
||||
this.replacePrivacyDomains = (str, user_preferences) => {
|
||||
if(typeof(user_preferences) == 'undefined')
|
||||
return str
|
||||
|
||||
let redditRegex = /([A-z.]+\.)?(reddit(\.com)|redd(\.it))/gm;
|
||||
let youtubeRegex = /([A-z.]+\.)?youtu(be\.com|\.be)/gm;
|
||||
let twitterRegex = /([A-z.]+\.)?twitter\.com/gm;
|
||||
|
@ -174,6 +171,9 @@ module.exports = function(request, fs) {
|
|||
|
||||
str = str.replace(redditRegex, config.domain)
|
||||
|
||||
if(typeof(user_preferences) == 'undefined')
|
||||
return str
|
||||
|
||||
if(typeof(user_preferences.domain_youtube) != 'undefined')
|
||||
if(user_preferences.domain_youtube)
|
||||
str = str.replace(youtubeRegex, user_preferences.domain_youtube)
|
||||
|
|
Loading…
Reference in New Issue