mirror of https://gitlab.com/bashrc2/epicyon
Permitted DM instances within edit profile screen
parent
702fa3167f
commit
91c955006a
17
daemon.py
17
daemon.py
|
@ -5019,11 +5019,24 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
if os.path.isfile(blockedFilename):
|
||||
os.remove(blockedFilename)
|
||||
|
||||
# Save DM allowed instances list.
|
||||
# The allow list for incoming DMs,
|
||||
# if the .followDMs flag file exists
|
||||
dmAllowedInstancesFilename = \
|
||||
baseDir + '/accounts/' + \
|
||||
nickname + '@' + domain + '/dmAllowedinstances.txt'
|
||||
if fields.get('dmAllowedInstances'):
|
||||
with open(dmAllowedInstancesFilename, 'w+') as aFile:
|
||||
aFile.write(fields['dmAllowedInstances'])
|
||||
else:
|
||||
if os.path.isfile(dmAllowedInstancesFilename):
|
||||
os.remove(dmAllowedInstancesFilename)
|
||||
|
||||
# save allowed instances list
|
||||
# This is the account level allow list
|
||||
allowedInstancesFilename = \
|
||||
baseDir + '/accounts/' + \
|
||||
nickname + '@' + domain + \
|
||||
'/allowedinstances.txt'
|
||||
nickname + '@' + domain + '/allowedinstances.txt'
|
||||
if fields.get('allowedInstances'):
|
||||
with open(allowedInstancesFilename, 'w+') as aFile:
|
||||
aFile.write(fields['allowedInstances'])
|
||||
|
|
|
@ -401,5 +401,7 @@
|
|||
"counselor": "مستشار",
|
||||
"Counselors": "المستشارين",
|
||||
"shocked": "صدمت",
|
||||
"Encrypted": "مشفر"
|
||||
"Encrypted": "مشفر",
|
||||
"Direct Message permitted instances": "الرسالة المباشرة المسموح بها",
|
||||
"Direct messages are always allowed from these instances.": "الرسائل المباشرة مسموح بها دائما من هذه المثيلات."
|
||||
}
|
||||
|
|
|
@ -401,5 +401,7 @@
|
|||
"counselor": "conseller",
|
||||
"Counselors": "Consellers",
|
||||
"shocked": "sorprès",
|
||||
"Encrypted": "Xifrat"
|
||||
"Encrypted": "Xifrat",
|
||||
"Direct Message permitted instances": "Instàncies permeses del missatge directe",
|
||||
"Direct messages are always allowed from these instances.": "Els missatges directes sempre estan permesos d'aquests casos."
|
||||
}
|
||||
|
|
|
@ -401,5 +401,7 @@
|
|||
"counselor": "cynghorydd",
|
||||
"Counselors": "Cynghorwyr",
|
||||
"shocked": "sioc",
|
||||
"Encrypted": "Amgryptio"
|
||||
"Encrypted": "Amgryptio",
|
||||
"Direct Message permitted instances": "Achosion a ganiateir negeseuon uniongyrchol",
|
||||
"Direct messages are always allowed from these instances.": "Caniateir negeseuon uniongyrchol bob amser o'r achosion hyn."
|
||||
}
|
||||
|
|
|
@ -401,5 +401,7 @@
|
|||
"counselor": "Beraterin",
|
||||
"Counselors": "Berater",
|
||||
"shocked": "schockiert",
|
||||
"Encrypted": "Verschlüsselt"
|
||||
"Encrypted": "Verschlüsselt",
|
||||
"Direct Message permitted instances": "Direktnachricht erlaubte Instanzen",
|
||||
"Direct messages are always allowed from these instances.": "Direkte Nachrichten sind in diesen Fällen immer zulässig."
|
||||
}
|
||||
|
|
|
@ -401,5 +401,7 @@
|
|||
"counselor": "counselor",
|
||||
"Counselors": "Counselors",
|
||||
"shocked": "shocked",
|
||||
"Encrypted": "Encrypted"
|
||||
"Encrypted": "Encrypted",
|
||||
"Direct Message permitted instances": "Direct Message permitted instances",
|
||||
"Direct messages are always allowed from these instances.": "Direct messages are always allowed from these instances."
|
||||
}
|
||||
|
|
|
@ -401,5 +401,7 @@
|
|||
"counselor": "Consejera",
|
||||
"Counselors": "Consejeras",
|
||||
"shocked": "conmocionada",
|
||||
"Encrypted": "Cifrada"
|
||||
"Encrypted": "Cifrada",
|
||||
"Direct Message permitted instances": "Mensaje directo permitido instancias",
|
||||
"Direct messages are always allowed from these instances.": "Los mensajes directos siempre están permitidos de estas instancias."
|
||||
}
|
||||
|
|
|
@ -401,5 +401,7 @@
|
|||
"counselor": "Conseillère",
|
||||
"Counselors": "Conseillères",
|
||||
"shocked": "sous le choc",
|
||||
"Encrypted": "Crypté"
|
||||
"Encrypted": "Crypté",
|
||||
"Direct Message permitted instances": "Message direct des instances autorisées",
|
||||
"Direct messages are always allowed from these instances.": "Les messages directs sont toujours autorisés dans ces instances."
|
||||
}
|
||||
|
|
|
@ -401,5 +401,7 @@
|
|||
"counselor": "Comhairleoir",
|
||||
"Counselors": "Comhairleoirí",
|
||||
"shocked": "ionadh",
|
||||
"Encrypted": "Criptithe"
|
||||
"Encrypted": "Criptithe",
|
||||
"Direct Message permitted instances": "Ceadaíonn teachtaireacht dhíreach cásanna",
|
||||
"Direct messages are always allowed from these instances.": "Ceadaítear teachtaireachtaí díreacha i gcónaí ó na cásanna seo."
|
||||
}
|
||||
|
|
|
@ -401,5 +401,7 @@
|
|||
"counselor": "काउंसलर",
|
||||
"Counselors": "सलाहकार",
|
||||
"shocked": "हैरान",
|
||||
"Encrypted": "को गोपित"
|
||||
"Encrypted": "को गोपित",
|
||||
"Direct Message permitted instances": "प्रत्यक्ष संदेश अनुमत उदाहरण",
|
||||
"Direct messages are always allowed from these instances.": "इन उदाहरणों से प्रत्यक्ष संदेश हमेशा अनुमति देते हैं।"
|
||||
}
|
||||
|
|
|
@ -401,5 +401,7 @@
|
|||
"counselor": "Consulente",
|
||||
"Counselors": "Consiglieri",
|
||||
"shocked": "scioccata",
|
||||
"Encrypted": "Crittografato"
|
||||
"Encrypted": "Crittografato",
|
||||
"Direct Message permitted instances": "Messaggio diretto istanze consentite",
|
||||
"Direct messages are always allowed from these instances.": "I messaggi diretti sono sempre ammessi da questi casi."
|
||||
}
|
||||
|
|
|
@ -401,5 +401,7 @@
|
|||
"counselor": "カウンセラー",
|
||||
"Counselors": "カウンセラー",
|
||||
"shocked": "ショックを受けた",
|
||||
"Encrypted": "暗号化"
|
||||
"Encrypted": "暗号化",
|
||||
"Direct Message permitted instances": "直接メッセージ許可インスタンス",
|
||||
"Direct messages are always allowed from these instances.": "直接メッセージは常にこれらのインスタンスから許可されています。"
|
||||
}
|
||||
|
|
|
@ -401,5 +401,7 @@
|
|||
"counselor": "Pêşnîyarvan",
|
||||
"Counselors": "Selêwirmendan",
|
||||
"shocked": "şok kirin",
|
||||
"Encrypted": "Encîfre kirin"
|
||||
"Encrypted": "Encîfre kirin",
|
||||
"Direct Message permitted instances": "Peyama rasterast destûrê",
|
||||
"Direct messages are always allowed from these instances.": "Peyamên rasterast her gav ji van deman têne destûr kirin."
|
||||
}
|
||||
|
|
|
@ -397,5 +397,7 @@
|
|||
"counselor": "Counselors",
|
||||
"Counselors": "Counselors",
|
||||
"shocked": "shocked",
|
||||
"Encrypted": "Encrypted"
|
||||
"Encrypted": "Encrypted",
|
||||
"Direct Message permitted instances": "Direct Message permitted instances",
|
||||
"Direct messages are always allowed from these instances.": "Direct messages are always allowed from these instances."
|
||||
}
|
||||
|
|
|
@ -401,5 +401,7 @@
|
|||
"counselor": "Conselheira",
|
||||
"Counselors": "Conselheiras",
|
||||
"shocked": "chocada",
|
||||
"Encrypted": "Criptografada"
|
||||
"Encrypted": "Criptografada",
|
||||
"Direct Message permitted instances": "Mensagens diretas permitidas instâncias",
|
||||
"Direct messages are always allowed from these instances.": "Mensagens diretas são sempre permitidas a partir dessas instâncias."
|
||||
}
|
||||
|
|
|
@ -401,5 +401,7 @@
|
|||
"counselor": "Советник",
|
||||
"Counselors": "Советники",
|
||||
"shocked": "потрясенный",
|
||||
"Encrypted": "Зашифрованный"
|
||||
"Encrypted": "Зашифрованный",
|
||||
"Direct Message permitted instances": "Прямое сообщение разрешено экземпляры",
|
||||
"Direct messages are always allowed from these instances.": "Прямые сообщения всегда допускаются из этих экземпляров."
|
||||
}
|
||||
|
|
|
@ -401,5 +401,7 @@
|
|||
"counselor": "顾问",
|
||||
"Counselors": "辅导员",
|
||||
"shocked": "震惊的",
|
||||
"Encrypted": "加密的"
|
||||
"Encrypted": "加密的",
|
||||
"Direct Message permitted instances": "直接留言允许实例",
|
||||
"Direct messages are always allowed from these instances.": "这些实例始终允许直接消息。"
|
||||
}
|
||||
|
|
8
utils.py
8
utils.py
|
@ -2214,11 +2214,11 @@ def dmAllowedFromDomain(baseDir: str,
|
|||
i.e. Mostly you only want DMs from followers, but there are
|
||||
a few particular instances that you trust
|
||||
"""
|
||||
dmAllowedDomainsFilename = \
|
||||
dmAllowedInstancesFilename = \
|
||||
baseDir + '/accounts/' + \
|
||||
nickname + '@' + domain + '/dmAllowedDomains.txt'
|
||||
if not os.path.isfile(dmAllowedDomainsFilename):
|
||||
nickname + '@' + domain + '/dmAllowedInstances.txt'
|
||||
if not os.path.isfile(dmAllowedInstancesFilename):
|
||||
return False
|
||||
if sendingActorDomain + '\n' in open(dmAllowedDomainsFilename).read():
|
||||
if sendingActorDomain + '\n' in open(dmAllowedInstancesFilename).read():
|
||||
return True
|
||||
return False
|
||||
|
|
|
@ -1184,6 +1184,14 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
|||
with open(blockedFilename, 'r') as blockedfile:
|
||||
blockedStr = blockedfile.read()
|
||||
|
||||
dmAllowedInstancesStr = ''
|
||||
dmAllowedInstancesFilename = \
|
||||
baseDir + '/accounts/' + \
|
||||
nickname + '@' + domain + '/dmAllowedInstances.txt'
|
||||
if os.path.isfile(dmAllowedInstancesFilename):
|
||||
with open(dmAllowedInstancesFilename, 'r') as dmAllowedInstancesFile:
|
||||
dmAllowedInstancesStr = dmAllowedInstancesFile.read()
|
||||
|
||||
allowedInstancesStr = ''
|
||||
allowedInstancesFilename = \
|
||||
baseDir + '/accounts/' + \
|
||||
|
@ -1740,6 +1748,18 @@ def htmlEditProfile(cssCache: {}, translate: {}, baseDir: str, path: str,
|
|||
' <textarea id="message" name="blocked" style="height:200px" ' + \
|
||||
'spellcheck="false">' + blockedStr + '</textarea>\n'
|
||||
|
||||
editProfileForm += \
|
||||
' <br><b><label class="labels">' + \
|
||||
translate['Direct Message permitted instances'] + '</label></b>\n'
|
||||
idx = 'Direct messages are always allowed from these instances.'
|
||||
editProfileForm += \
|
||||
' <br><label class="labels">' + \
|
||||
translate[idx] + '</label>\n'
|
||||
editProfileForm += \
|
||||
' <textarea id="message" name="dmAllowedInstances" ' + \
|
||||
'style="height:200px" spellcheck="false">' + \
|
||||
dmAllowedInstancesStr + '</textarea>\n'
|
||||
|
||||
editProfileForm += \
|
||||
' <br><b><label class="labels">' + \
|
||||
translate['Federation list'] + '</label></b>\n'
|
||||
|
|
Loading…
Reference in New Issue