diff --git a/daemon.py b/daemon.py
index 701c49a1d..967f55b9f 100644
--- a/daemon.py
+++ b/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'])
diff --git a/translations/ar.json b/translations/ar.json
index 0f9847479..1d924ac55 100644
--- a/translations/ar.json
+++ b/translations/ar.json
@@ -401,5 +401,7 @@
"counselor": "مستشار",
"Counselors": "المستشارين",
"shocked": "صدمت",
- "Encrypted": "مشفر"
+ "Encrypted": "مشفر",
+ "Direct Message permitted instances": "الرسالة المباشرة المسموح بها",
+ "Direct messages are always allowed from these instances.": "الرسائل المباشرة مسموح بها دائما من هذه المثيلات."
}
diff --git a/translations/ca.json b/translations/ca.json
index b44f228fe..47487a6f6 100644
--- a/translations/ca.json
+++ b/translations/ca.json
@@ -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."
}
diff --git a/translations/cy.json b/translations/cy.json
index 0f8362073..fe5c966be 100644
--- a/translations/cy.json
+++ b/translations/cy.json
@@ -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."
}
diff --git a/translations/de.json b/translations/de.json
index bf5189e6c..70099d937 100644
--- a/translations/de.json
+++ b/translations/de.json
@@ -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."
}
diff --git a/translations/en.json b/translations/en.json
index 6840c67f2..328038954 100644
--- a/translations/en.json
+++ b/translations/en.json
@@ -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."
}
diff --git a/translations/es.json b/translations/es.json
index 901f8b515..c2f3a2e74 100644
--- a/translations/es.json
+++ b/translations/es.json
@@ -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."
}
diff --git a/translations/fr.json b/translations/fr.json
index 6d25dbd97..68d246462 100644
--- a/translations/fr.json
+++ b/translations/fr.json
@@ -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."
}
diff --git a/translations/ga.json b/translations/ga.json
index a997cb359..c8c8d8911 100644
--- a/translations/ga.json
+++ b/translations/ga.json
@@ -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."
}
diff --git a/translations/hi.json b/translations/hi.json
index 0bc6813a1..b36a7ad2a 100644
--- a/translations/hi.json
+++ b/translations/hi.json
@@ -401,5 +401,7 @@
"counselor": "काउंसलर",
"Counselors": "सलाहकार",
"shocked": "हैरान",
- "Encrypted": "को गोपित"
+ "Encrypted": "को गोपित",
+ "Direct Message permitted instances": "प्रत्यक्ष संदेश अनुमत उदाहरण",
+ "Direct messages are always allowed from these instances.": "इन उदाहरणों से प्रत्यक्ष संदेश हमेशा अनुमति देते हैं।"
}
diff --git a/translations/it.json b/translations/it.json
index 347d904e7..f540050d6 100644
--- a/translations/it.json
+++ b/translations/it.json
@@ -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."
}
diff --git a/translations/ja.json b/translations/ja.json
index ba402b9b3..8b129146e 100644
--- a/translations/ja.json
+++ b/translations/ja.json
@@ -401,5 +401,7 @@
"counselor": "カウンセラー",
"Counselors": "カウンセラー",
"shocked": "ショックを受けた",
- "Encrypted": "暗号化"
+ "Encrypted": "暗号化",
+ "Direct Message permitted instances": "直接メッセージ許可インスタンス",
+ "Direct messages are always allowed from these instances.": "直接メッセージは常にこれらのインスタンスから許可されています。"
}
diff --git a/translations/ku.json b/translations/ku.json
index 5e74514b1..86f856b8f 100644
--- a/translations/ku.json
+++ b/translations/ku.json
@@ -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."
}
diff --git a/translations/oc.json b/translations/oc.json
index f355a9485..370cc90dc 100644
--- a/translations/oc.json
+++ b/translations/oc.json
@@ -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."
}
diff --git a/translations/pt.json b/translations/pt.json
index b7b3206c8..5ed9a87c3 100644
--- a/translations/pt.json
+++ b/translations/pt.json
@@ -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."
}
diff --git a/translations/ru.json b/translations/ru.json
index bdf9754f8..924356521 100644
--- a/translations/ru.json
+++ b/translations/ru.json
@@ -401,5 +401,7 @@
"counselor": "Советник",
"Counselors": "Советники",
"shocked": "потрясенный",
- "Encrypted": "Зашифрованный"
+ "Encrypted": "Зашифрованный",
+ "Direct Message permitted instances": "Прямое сообщение разрешено экземпляры",
+ "Direct messages are always allowed from these instances.": "Прямые сообщения всегда допускаются из этих экземпляров."
}
diff --git a/translations/zh.json b/translations/zh.json
index 7814ba6bd..5d566eb8e 100644
--- a/translations/zh.json
+++ b/translations/zh.json
@@ -401,5 +401,7 @@
"counselor": "顾问",
"Counselors": "辅导员",
"shocked": "震惊的",
- "Encrypted": "加密的"
+ "Encrypted": "加密的",
+ "Direct Message permitted instances": "直接留言允许实例",
+ "Direct messages are always allowed from these instances.": "这些实例始终允许直接消息。"
}
diff --git a/utils.py b/utils.py
index c08a5d8e1..170920146 100644
--- a/utils.py
+++ b/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
diff --git a/webapp_profile.py b/webapp_profile.py
index fd2893cb2..0f252853e 100644
--- a/webapp_profile.py
+++ b/webapp_profile.py
@@ -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,
' \n'
+ editProfileForm += \
+ '
\n'
+ idx = 'Direct messages are always allowed from these instances.'
+ editProfileForm += \
+ '
\n'
+ editProfileForm += \
+ ' \n'
+
editProfileForm += \
'
\n'