From 9fdc2e103933962c1446b377cf1a508ea070e9f4 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 28 Nov 2019 17:03:57 +0000 Subject: [PATCH] Set media instance in admin profile --- daemon.py | 9 ++++++++- translations/ar.json | 3 ++- translations/ca.json | 3 ++- translations/cy.json | 3 ++- translations/de.json | 3 ++- translations/en.json | 3 ++- translations/es.json | 3 ++- translations/fr.json | 3 ++- translations/ga.json | 3 ++- translations/hi.json | 3 ++- translations/it.json | 3 ++- translations/ja.json | 3 ++- translations/oc.json | 3 ++- translations/pt.json | 3 ++- translations/ru.json | 3 ++- translations/zh.json | 3 ++- webinterface.py | 8 ++++++++ 17 files changed, 46 insertions(+), 16 deletions(-) diff --git a/daemon.py b/daemon.py index 55160fb7..8e9d76d9 100644 --- a/daemon.py +++ b/daemon.py @@ -4121,7 +4121,14 @@ class PubServer(BaseHTTPRequestHandler): approveFollowers=True if approveFollowers!=actorJson['manuallyApprovesFollowers']: 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 followDMsFilename= \ self.server.baseDir+'/accounts/'+ \ diff --git a/translations/ar.json b/translations/ar.json index 1f3ffb7d..65cf2a99 100644 --- a/translations/ar.json +++ b/translations/ar.json @@ -197,5 +197,6 @@ "announces": "يعلن", "Previous month": "الشهر الماضى", "Next month": "الشهر القادم", - "Get the source code": "الحصول على شفرة المصدر" + "Get the source code": "الحصول على شفرة المصدر", + "This is a media instance": "This is a media instance" } diff --git a/translations/ca.json b/translations/ca.json index b4cf704a..e363d3ee 100644 --- a/translations/ca.json +++ b/translations/ca.json @@ -197,5 +197,6 @@ "announces": "anuncia", "Previous month": "Mes anterior", "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" } diff --git a/translations/cy.json b/translations/cy.json index 3e928310..ea572c6b 100644 --- a/translations/cy.json +++ b/translations/cy.json @@ -197,5 +197,6 @@ "announces": "yn cyhoeddi", "Previous month": "Y mis blaenorol", "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" } diff --git a/translations/de.json b/translations/de.json index 2b9946b4..189eac6c 100644 --- a/translations/de.json +++ b/translations/de.json @@ -197,5 +197,6 @@ "announces": "kündigt an", "Previous month": "Vorheriger 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" } diff --git a/translations/en.json b/translations/en.json index e0bbb221..970c3bf4 100644 --- a/translations/en.json +++ b/translations/en.json @@ -197,5 +197,6 @@ "announces": "announces", "Previous month": "Previous 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" } diff --git a/translations/es.json b/translations/es.json index 10e85ca7..f78f9a5a 100644 --- a/translations/es.json +++ b/translations/es.json @@ -197,5 +197,6 @@ "announces": "anuncia", "Previous month": "Mes anterior", "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" } diff --git a/translations/fr.json b/translations/fr.json index 89460400..8f8c87fe 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -197,5 +197,6 @@ "announces": "annonce", "Previous month": "Le mois précédent", "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" } diff --git a/translations/ga.json b/translations/ga.json index ac0222ef..5b4097c6 100644 --- a/translations/ga.json +++ b/translations/ga.json @@ -197,5 +197,6 @@ "announces": "fógraíonn", "Previous month": "An mhí roimhe seo", "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" } diff --git a/translations/hi.json b/translations/hi.json index 65dff3c5..61686e78 100644 --- a/translations/hi.json +++ b/translations/hi.json @@ -197,5 +197,6 @@ "announces": "की घोषणा", "Previous month": "पिछ्ला महिना", "Next month": "अगले महीने", - "Get the source code": "स्रोत कोड प्राप्त करें" + "Get the source code": "स्रोत कोड प्राप्त करें", + "This is a media instance": "This is a media instance" } diff --git a/translations/it.json b/translations/it.json index 9daf8820..2700c361 100644 --- a/translations/it.json +++ b/translations/it.json @@ -197,5 +197,6 @@ "announces": "annuncia", "Previous month": "Il mese scorso", "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" } diff --git a/translations/ja.json b/translations/ja.json index 229e0563..6c88672c 100644 --- a/translations/ja.json +++ b/translations/ja.json @@ -197,5 +197,6 @@ "announces": "発表する", "Previous month": "前月", "Next month": "来月", - "Get the source code": "ソースコードを入手する" + "Get the source code": "ソースコードを入手する", + "This is a media instance": "This is a media instance" } diff --git a/translations/oc.json b/translations/oc.json index f77e0a9d..fcd5ffac 100644 --- a/translations/oc.json +++ b/translations/oc.json @@ -193,5 +193,6 @@ "announces": "announces", "Previous month": "Previous 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" } diff --git a/translations/pt.json b/translations/pt.json index c834a222..04091833 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -197,5 +197,6 @@ "announces": "anuncia", "Previous month": "Mês anterior", "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" } diff --git a/translations/ru.json b/translations/ru.json index 2e3ff8bd..04e981e4 100644 --- a/translations/ru.json +++ b/translations/ru.json @@ -197,5 +197,6 @@ "announces": "анонсов", "Previous month": "Предыдущий месяц", "Next month": "В следующем месяце", - "Get the source code": "Получить исходный код" + "Get the source code": "Получить исходный код", + "This is a media instance": "This is a media instance" } diff --git a/translations/zh.json b/translations/zh.json index fdbc2d32..c0d02963 100644 --- a/translations/zh.json +++ b/translations/zh.json @@ -197,5 +197,6 @@ "announces": "宣布", "Previous month": "前一个月", "Next month": "下个月", - "Get the source code": "获取源代码" + "Get the source code": "获取源代码", + "This is a media instance": "This is a media instance" } diff --git a/webinterface.py b/webinterface.py index c2d50336..290d38d8 100644 --- a/webinterface.py +++ b/webinterface.py @@ -532,6 +532,7 @@ def htmlEditProfile(translate: {},baseDir: str,path: str,domain: str,port: int) isBot='' isGroup='' followDMs='' + mediaInstanceStr='' displayNickname=nickname bioStr='' donateUrl='' @@ -557,6 +558,11 @@ def htmlEditProfile(translate: {},baseDir: str,path: str,domain: str,port: int) isBot='' if os.path.isfile(baseDir+'/accounts/'+nickname+'@'+domain+'/.followDMs'): followDMs='checked' + + mediaInstance=getConfigParam(baseDir,"mediaInstance") + if mediaInstance: + if mediaInstance==True: + mediaInstanceStr='checked' filterStr='' filterFilename=baseDir+'/accounts/'+nickname+'@'+domain+'/filters.txt' @@ -677,6 +683,8 @@ def htmlEditProfile(translate: {},baseDir: str,path: str,domain: str,port: int) editProfileForm+=' '+translate['This is a bot account']+'
' editProfileForm+=' '+translate['This is a group account']+'
' editProfileForm+=' '+translate['Only people I follow can send me DMs']+'
' + if path.startswith('/users/'+adminNickname+'/'): + editProfileForm+=' '+translate['This is a media instance']+'
' editProfileForm+='
' editProfileForm+='
' editProfileForm+=' '