diff --git a/daemon.py b/daemon.py index 06096e8f..45371a39 100644 --- a/daemon.py +++ b/daemon.py @@ -4320,6 +4320,16 @@ class PubServer(BaseHTTPRequestHandler): else: if os.path.isfile(filterFilename): os.remove(filterFilename) + # word replacements + switchFilename= \ + self.server.baseDir+'/accounts/'+ \ + nickname+'@'+self.server.domain+'/replacewords.txt' + if fields.get('switchWords'): + with open(switchFilename, "w") as switchfile: + switchfile.write(fields['switchWords']) + else: + if os.path.isfile(switchFilename): + os.remove(switchFilename) # save blocked accounts list blockedFilename= \ self.server.baseDir+'/accounts/'+ \ diff --git a/webinterface.py b/webinterface.py index ed71604c..6cee1afa 100644 --- a/webinterface.py +++ b/webinterface.py @@ -647,6 +647,12 @@ def htmlEditProfile(translate: {},baseDir: str,path: str,domain: str,port: int,h with open(filterFilename, 'r') as filterfile: filterStr=filterfile.read() + switchStr='' + switchFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/replacewords.txt' + if os.path.isfile(switchFilename): + with open(switchFilename, 'r') as switchfile: + switchStr=switchfile.read() + blockedStr='' blockedFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/blocking.txt' if os.path.isfile(blockedFilename): @@ -779,9 +785,15 @@ def htmlEditProfile(translate: {},baseDir: str,path: str,domain: str,port: int,h editProfileForm+=' '+translate['Remove Twitter posts']+'
' if path.startswith('/users/'+adminNickname+'/'): editProfileForm+=' '+translate['This is a media instance']+'
' + editProfileForm+='
' editProfileForm+='
' editProfileForm+=' ' + + editProfileForm+='
' + editProfileForm+='
' + editProfileForm+=' ' + editProfileForm+='
' editProfileForm+='
' editProfileForm+=' '