Set media instance in admin profile

main
Bob Mottram 2019-11-28 17:03:57 +00:00
parent 7779ab44e3
commit 9fdc2e1039
17 changed files with 46 additions and 16 deletions

View File

@ -4121,7 +4121,14 @@ class PubServer(BaseHTTPRequestHandler):
approveFollowers=True approveFollowers=True
if approveFollowers!=actorJson['manuallyApprovesFollowers']: if approveFollowers!=actorJson['manuallyApprovesFollowers']:
actorJson['manuallyApprovesFollowers']=approveFollowers actorJson['manuallyApprovesFollowers']=approveFollowers
actorChanged=True actorChanged=True
if fields.get('mediaInstance'):
self.server.mediaInstance=False
self.server.defaultTimeline='inbox'
if fields['mediaInstance']=='on':
self.server.mediaInstance=True
self.server.defaultTimeline='tlmedia'
setConfigParam(self.server.baseDir,"mediaInstance",self.server.mediaInstance)
# only receive DMs from accounts you follow # only receive DMs from accounts you follow
followDMsFilename= \ followDMsFilename= \
self.server.baseDir+'/accounts/'+ \ self.server.baseDir+'/accounts/'+ \

View File

@ -197,5 +197,6 @@
"announces": "يعلن", "announces": "يعلن",
"Previous month": "الشهر الماضى", "Previous month": "الشهر الماضى",
"Next month": "الشهر القادم", "Next month": "الشهر القادم",
"Get the source code": "الحصول على شفرة المصدر" "Get the source code": "الحصول على شفرة المصدر",
"This is a media instance": "This is a media instance"
} }

View File

@ -197,5 +197,6 @@
"announces": "anuncia", "announces": "anuncia",
"Previous month": "Mes anterior", "Previous month": "Mes anterior",
"Next month": "El mes que ve", "Next month": "El mes que ve",
"Get the source code": "Obteniu el codi font" "Get the source code": "Obteniu el codi font",
"This is a media instance": "This is a media instance"
} }

View File

@ -197,5 +197,6 @@
"announces": "yn cyhoeddi", "announces": "yn cyhoeddi",
"Previous month": "Y mis blaenorol", "Previous month": "Y mis blaenorol",
"Next month": "Mis nesaf", "Next month": "Mis nesaf",
"Get the source code": "Sicrhewch y cod ffynhonnell" "Get the source code": "Sicrhewch y cod ffynhonnell",
"This is a media instance": "This is a media instance"
} }

View File

@ -197,5 +197,6 @@
"announces": "kündigt an", "announces": "kündigt an",
"Previous month": "Vorheriger Monat", "Previous month": "Vorheriger Monat",
"Next month": "Nächsten Monat", "Next month": "Nächsten Monat",
"Get the source code": "Holen Sie sich den Quellcode" "Get the source code": "Holen Sie sich den Quellcode",
"This is a media instance": "This is a media instance"
} }

View File

@ -197,5 +197,6 @@
"announces": "announces", "announces": "announces",
"Previous month": "Previous month", "Previous month": "Previous month",
"Next month": "Next month", "Next month": "Next month",
"Get the source code": "Get the source code" "Get the source code": "Get the source code",
"This is a media instance": "This is a media instance"
} }

View File

@ -197,5 +197,6 @@
"announces": "anuncia", "announces": "anuncia",
"Previous month": "Mes anterior", "Previous month": "Mes anterior",
"Next month": "Próximo mes", "Next month": "Próximo mes",
"Get the source code": "Obtén el código fuente" "Get the source code": "Obtén el código fuente",
"This is a media instance": "This is a media instance"
} }

View File

@ -197,5 +197,6 @@
"announces": "annonce", "announces": "annonce",
"Previous month": "Le mois précédent", "Previous month": "Le mois précédent",
"Next month": "Le mois prochain", "Next month": "Le mois prochain",
"Get the source code": "Obtenir le code source" "Get the source code": "Obtenir le code source",
"This is a media instance": "This is a media instance"
} }

View File

@ -197,5 +197,6 @@
"announces": "fógraíonn", "announces": "fógraíonn",
"Previous month": "An mhí roimhe seo", "Previous month": "An mhí roimhe seo",
"Next month": "An mhí seo chugainn", "Next month": "An mhí seo chugainn",
"Get the source code": "Faigh an cód foinse" "Get the source code": "Faigh an cód foinse",
"This is a media instance": "This is a media instance"
} }

View File

@ -197,5 +197,6 @@
"announces": "की घोषणा", "announces": "की घोषणा",
"Previous month": "पिछ्ला महिना", "Previous month": "पिछ्ला महिना",
"Next month": "अगले महीने", "Next month": "अगले महीने",
"Get the source code": "स्रोत कोड प्राप्त करें" "Get the source code": "स्रोत कोड प्राप्त करें",
"This is a media instance": "This is a media instance"
} }

View File

@ -197,5 +197,6 @@
"announces": "annuncia", "announces": "annuncia",
"Previous month": "Il mese scorso", "Previous month": "Il mese scorso",
"Next month": "Il prossimo mese", "Next month": "Il prossimo mese",
"Get the source code": "Ottieni il codice sorgente" "Get the source code": "Ottieni il codice sorgente",
"This is a media instance": "This is a media instance"
} }

View File

@ -197,5 +197,6 @@
"announces": "発表する", "announces": "発表する",
"Previous month": "前月", "Previous month": "前月",
"Next month": "来月", "Next month": "来月",
"Get the source code": "ソースコードを入手する" "Get the source code": "ソースコードを入手する",
"This is a media instance": "This is a media instance"
} }

View File

@ -193,5 +193,6 @@
"announces": "announces", "announces": "announces",
"Previous month": "Previous month", "Previous month": "Previous month",
"Next month": "Next month", "Next month": "Next month",
"Get the source code": "Get the source code" "Get the source code": "Get the source code",
"This is a media instance": "This is a media instance"
} }

View File

@ -197,5 +197,6 @@
"announces": "anuncia", "announces": "anuncia",
"Previous month": "Mês anterior", "Previous month": "Mês anterior",
"Next month": "Próximo mês", "Next month": "Próximo mês",
"Get the source code": "Obter o código fonte" "Get the source code": "Obter o código fonte",
"This is a media instance": "This is a media instance"
} }

View File

@ -197,5 +197,6 @@
"announces": "анонсов", "announces": "анонсов",
"Previous month": "Предыдущий месяц", "Previous month": "Предыдущий месяц",
"Next month": "В следующем месяце", "Next month": "В следующем месяце",
"Get the source code": "Получить исходный код" "Get the source code": "Получить исходный код",
"This is a media instance": "This is a media instance"
} }

View File

@ -197,5 +197,6 @@
"announces": "宣布", "announces": "宣布",
"Previous month": "前一个月", "Previous month": "前一个月",
"Next month": "下个月", "Next month": "下个月",
"Get the source code": "获取源代码" "Get the source code": "获取源代码",
"This is a media instance": "This is a media instance"
} }

View File

@ -532,6 +532,7 @@ def htmlEditProfile(translate: {},baseDir: str,path: str,domain: str,port: int)
isBot='' isBot=''
isGroup='' isGroup=''
followDMs='' followDMs=''
mediaInstanceStr=''
displayNickname=nickname displayNickname=nickname
bioStr='' bioStr=''
donateUrl='' donateUrl=''
@ -557,6 +558,11 @@ def htmlEditProfile(translate: {},baseDir: str,path: str,domain: str,port: int)
isBot='' isBot=''
if os.path.isfile(baseDir+'/accounts/'+nickname+'@'+domain+'/.followDMs'): if os.path.isfile(baseDir+'/accounts/'+nickname+'@'+domain+'/.followDMs'):
followDMs='checked' followDMs='checked'
mediaInstance=getConfigParam(baseDir,"mediaInstance")
if mediaInstance:
if mediaInstance==True:
mediaInstanceStr='checked'
filterStr='' filterStr=''
filterFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/filters.txt' filterFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/filters.txt'
@ -677,6 +683,8 @@ def htmlEditProfile(translate: {},baseDir: str,path: str,domain: str,port: int)
editProfileForm+=' <input type="checkbox" class=profilecheckbox" name="isBot" '+isBot+'>'+translate['This is a bot account']+'<br>' editProfileForm+=' <input type="checkbox" class=profilecheckbox" name="isBot" '+isBot+'>'+translate['This is a bot account']+'<br>'
editProfileForm+=' <input type="checkbox" class=profilecheckbox" name="isGroup" '+isGroup+'>'+translate['This is a group account']+'<br>' editProfileForm+=' <input type="checkbox" class=profilecheckbox" name="isGroup" '+isGroup+'>'+translate['This is a group account']+'<br>'
editProfileForm+=' <input type="checkbox" class=profilecheckbox" name="followDMs" '+followDMs+'>'+translate['Only people I follow can send me DMs']+'<br>' editProfileForm+=' <input type="checkbox" class=profilecheckbox" name="followDMs" '+followDMs+'>'+translate['Only people I follow can send me DMs']+'<br>'
if path.startswith('/users/'+adminNickname+'/'):
editProfileForm+=' <input type="checkbox" class=profilecheckbox" name="mediaInstance" '+mediaInstanceStr+'>'+translate['This is a media instance']+'<br>'
editProfileForm+=' <br><b><label class="labels">'+translate['Filtered words']+'</label></b>' editProfileForm+=' <br><b><label class="labels">'+translate['Filtered words']+'</label></b>'
editProfileForm+=' <br><label class="labels">'+translate['One per line']+'</label>' editProfileForm+=' <br><label class="labels">'+translate['One per line']+'</label>'
editProfileForm+=' <textarea id="message" name="filteredWords" style="height:200px">'+filterStr+'</textarea>' editProfileForm+=' <textarea id="message" name="filteredWords" style="height:200px">'+filterStr+'</textarea>'