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 55160fb70..8e9d76d94 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 1f3ffb7d7..65cf2a99c 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 b4cf704aa..e363d3ee8 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 3e928310a..ea572c6be 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 2b9946b43..189eac6c0 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 e0bbb2212..970c3bf44 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 10e85ca7a..f78f9a5ae 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 894604006..8f8c87fe1 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 ac0222efc..5b4097c6f 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 65dff3c56..61686e783 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 9daf88209..2700c3617 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 229e05633..6c88672cb 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 f77e0a9d8..fcd5ffacf 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 c834a222a..04091833c 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 2e3ff8bda..04e981e4d 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 fdbc2d32c..c0d02963f 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 c2d503363..290d38d8f 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+=' '