diff --git a/content.py b/content.py
index 72b778438..29aa60d4b 100644
--- a/content.py
+++ b/content.py
@@ -1165,6 +1165,12 @@ def add_html_tags(base_dir: str, http_prefix: str,
now_playing_str = 'NowPlaying'
if translate.get(now_playing_str):
now_playing_str = translate[now_playing_str]
+ now_playing_lower_str = 'nowplaying'
+ if translate.get(now_playing_lower_str):
+ now_playing_lower_str = translate[now_playing_lower_str]
+ if '#' + now_playing_lower_str in content:
+ content = content.replace('#' + now_playing_lower_str,
+ '#' + now_playing_str)
content = _add_music_tag(content, now_playing_str)
words = _get_simplified_content(content).split(' ')
diff --git a/daemon.py b/daemon.py
index 0dc3d98e7..9acff8c2e 100644
--- a/daemon.py
+++ b/daemon.py
@@ -168,6 +168,7 @@ from webapp_minimalbutton import is_minimal
from webapp_utils import get_avatar_image_url
from webapp_utils import html_hashtag_blocked
from webapp_utils import html_following_list
+from webapp_utils import csv_following_list
from webapp_utils import set_blog_address
from webapp_utils import html_show_share
from webapp_utils import get_pwa_theme_colors
@@ -15657,11 +15658,14 @@ class PubServer(BaseHTTPRequestHandler):
# is this a html/ssml/icalendar request?
html_getreq = False
+ csv_getreq = False
ssml_getreq = False
icalendar_getreq = False
if self._has_accept(calling_domain):
if self._request_http():
html_getreq = True
+ elif self._request_csv():
+ csv_getreq = True
elif self._request_ssml():
ssml_getreq = True
elif self._request_icalendar():
@@ -16368,8 +16372,9 @@ class PubServer(BaseHTTPRequestHandler):
self.server.debug)
# show a list of who you are following
- if html_getreq and authorized and users_in_path and \
- self.path.endswith('/followingaccounts'):
+ if (authorized and users_in_path and
+ (self.path.endswith('/followingaccounts') or
+ self.path.endswith('/followingaccounts.csv'))):
nickname = get_nickname_from_actor(self.path)
if not nickname:
self._404()
@@ -16380,10 +16385,22 @@ class PubServer(BaseHTTPRequestHandler):
if not os.path.isfile(following_filename):
self._404()
return
- msg = html_following_list(self.server.base_dir, following_filename)
- msglen = len(msg)
- self._login_headers('text/html', msglen, calling_domain)
- self._write(msg.encode('utf-8'))
+ if self.path.endswith('/followingaccounts.csv'):
+ html_getreq = False
+ csv_getreq = True
+ if html_getreq:
+ msg = html_following_list(self.server.base_dir,
+ following_filename)
+ msglen = len(msg)
+ self._login_headers('text/html', msglen, calling_domain)
+ self._write(msg.encode('utf-8'))
+ elif csv_getreq:
+ msg = csv_following_list(following_filename)
+ msglen = len(msg)
+ self._login_headers('text/csv', msglen, calling_domain)
+ self._write(msg.encode('utf-8'))
+ else:
+ self._404()
fitness_performance(getreq_start_time, self.server.fitness,
'_GET', 'following accounts shown',
self.server.debug)
@@ -16393,6 +16410,41 @@ class PubServer(BaseHTTPRequestHandler):
'_GET', 'following accounts done',
self.server.debug)
+ # show a list of who are your followers
+ if authorized and users_in_path and \
+ self.path.endswith('/followersaccounts'):
+ nickname = get_nickname_from_actor(self.path)
+ if not nickname:
+ self._404()
+ return
+ followers_filename = \
+ acct_dir(self.server.base_dir,
+ nickname, self.server.domain) + '/followers.txt'
+ if not os.path.isfile(followers_filename):
+ self._404()
+ return
+ if html_getreq:
+ msg = html_following_list(self.server.base_dir,
+ followers_filename)
+ msglen = len(msg)
+ self._login_headers('text/html', msglen, calling_domain)
+ self._write(msg.encode('utf-8'))
+ elif csv_getreq:
+ msg = csv_following_list(followers_filename)
+ msglen = len(msg)
+ self._login_headers('text/csv', msglen, calling_domain)
+ self._write(msg.encode('utf-8'))
+ else:
+ self._404()
+ fitness_performance(getreq_start_time, self.server.fitness,
+ '_GET', 'followers accounts shown',
+ self.server.debug)
+ return
+
+ fitness_performance(getreq_start_time, self.server.fitness,
+ '_GET', 'followers accounts done',
+ self.server.debug)
+
if self.path.endswith('/about'):
if calling_domain.endswith('.onion'):
msg = \
diff --git a/translations/ar.json b/translations/ar.json
index 8339fd807..e314205fc 100644
--- a/translations/ar.json
+++ b/translations/ar.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "كلمات Dogwhistle",
"Content warnings will be added for the following": "ستتم إضافة تحذيرات المحتوى لما يلي",
"nowplaying": "الان العب",
- "NowPlaying": "الان العب"
+ "NowPlaying": "الان العب",
+ "Import and Export": "استيراد وتصدير"
}
diff --git a/translations/bn.json b/translations/bn.json
index cc290a96f..18c83f201 100644
--- a/translations/bn.json
+++ b/translations/bn.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "কুকুরের হুইসেল শব্দ",
"Content warnings will be added for the following": "নিম্নলিখিত জন্য বিষয়বস্তু সতর্কতা যোগ করা হবে",
"nowplaying": "এখন চলছে",
- "NowPlaying": "এখন চলছে"
+ "NowPlaying": "এখন চলছে",
+ "Import and Export": "আমদানি এবং রপ্তানি"
}
diff --git a/translations/ca.json b/translations/ca.json
index f70b13086..70fd73081 100644
--- a/translations/ca.json
+++ b/translations/ca.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "Paraules de xiulet",
"Content warnings will be added for the following": "S'afegiran advertències de contingut per al següent",
"nowplaying": "arajugant",
- "NowPlaying": "AraJugant"
+ "NowPlaying": "AraJugant",
+ "Import and Export": "Importació i Exportació"
}
diff --git a/translations/cy.json b/translations/cy.json
index e788810eb..691a6352e 100644
--- a/translations/cy.json
+++ b/translations/cy.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "Geiriau chwibanogl",
"Content warnings will be added for the following": "Bydd rhybuddion cynnwys yn cael eu hychwanegu ar gyfer y canlynol",
"nowplaying": "nawrynchwarae",
- "NowPlaying": "NawrYnChwarae"
+ "NowPlaying": "NawrYnChwarae",
+ "Import and Export": "Mewnforio ac Allforio"
}
diff --git a/translations/de.json b/translations/de.json
index 8d152ad06..0961227c0 100644
--- a/translations/de.json
+++ b/translations/de.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "Hundepfeife Worte",
"Content warnings will be added for the following": "Inhaltswarnungen werden für Folgendes hinzugefügt",
"nowplaying": "läuftgerade",
- "NowPlaying": "LäuftGerade"
+ "NowPlaying": "LäuftGerade",
+ "Import and Export": "Import und Export"
}
diff --git a/translations/el.json b/translations/el.json
index d6b9d34c3..86895f005 100644
--- a/translations/el.json
+++ b/translations/el.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "Σφυρίχτρα λέξεις",
"Content warnings will be added for the following": "Θα προστεθούν προειδοποιήσεις περιεχομένου για τα ακόλουθα",
"nowplaying": "τώραπαίζει",
- "NowPlaying": "ΤώραΠαίζει"
+ "NowPlaying": "ΤώραΠαίζει",
+ "Import and Export": "Εισάγω και εξάγω"
}
diff --git a/translations/en.json b/translations/en.json
index c569f76f3..da9fd9a5c 100644
--- a/translations/en.json
+++ b/translations/en.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "Dogwhistle words",
"Content warnings will be added for the following": "Content warnings will be added for the following",
"nowplaying": "nowplaying",
- "NowPlaying": "NowPlaying"
+ "NowPlaying": "NowPlaying",
+ "Import and Export": "Import and Export"
}
diff --git a/translations/es.json b/translations/es.json
index 2cef0c1ee..c8b992c5b 100644
--- a/translations/es.json
+++ b/translations/es.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "Palabras de silbato para perros",
"Content warnings will be added for the following": "Se agregarán advertencias de contenido para lo siguiente",
"nowplaying": "jugandoahora",
- "NowPlaying": "JugandoAhora"
+ "NowPlaying": "JugandoAhora",
+ "Import and Export": "Importar y exportar"
}
diff --git a/translations/fr.json b/translations/fr.json
index 5c3b6c427..fb5c7d630 100644
--- a/translations/fr.json
+++ b/translations/fr.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "Mots de sifflet de chien",
"Content warnings will be added for the following": "Des avertissements de contenu seront ajoutés pour les éléments suivants",
"nowplaying": "lectureencours",
- "NowPlaying": "LectureEnCours"
+ "NowPlaying": "LectureEnCours",
+ "Import and Export": "Importer et exporter"
}
diff --git a/translations/ga.json b/translations/ga.json
index 2e2731714..e0a9db521 100644
--- a/translations/ga.json
+++ b/translations/ga.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "Focail feadóg mhadra",
"Content warnings will be added for the following": "Cuirfear rabhaidh ábhair leis maidir leis na nithe seo a leanas",
"nowplaying": "anoisagimirt",
- "NowPlaying": "AnoisAgImirt"
+ "NowPlaying": "AnoisAgImirt",
+ "Import and Export": "Iompórtáil agus Easpórtáil"
}
diff --git a/translations/hi.json b/translations/hi.json
index 30a8dc720..04279fab9 100644
--- a/translations/hi.json
+++ b/translations/hi.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "कुत्ते की सीटी शब्द",
"Content warnings will be added for the following": "निम्नलिखित के लिए सामग्री चेतावनियां जोड़ दी जाएंगी",
"nowplaying": "अब खेल रहे हैं",
- "NowPlaying": "अब खेल रहे हैं"
+ "NowPlaying": "अब खेल रहे हैं",
+ "Import and Export": "आयात और निर्यात"
}
diff --git a/translations/it.json b/translations/it.json
index 3827a9c06..0e0e63159 100644
--- a/translations/it.json
+++ b/translations/it.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "Parole da fischietto",
"Content warnings will be added for the following": "Verranno aggiunti avvisi sui contenuti per quanto segue",
"nowplaying": "ora giocando",
- "NowPlaying": "OraGiocando"
+ "NowPlaying": "OraGiocando",
+ "Import and Export": "Importazione e esportazione"
}
diff --git a/translations/ja.json b/translations/ja.json
index c698debdf..5560b16eb 100644
--- a/translations/ja.json
+++ b/translations/ja.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "犬笛の言葉",
"Content warnings will be added for the following": "以下のコンテンツ警告が追加されます",
"nowplaying": "再生中",
- "NowPlaying": "再生中"
+ "NowPlaying": "再生中",
+ "Import and Export": "インポートとエクスポート"
}
diff --git a/translations/ko.json b/translations/ko.json
index bd212761f..1a5616e52 100644
--- a/translations/ko.json
+++ b/translations/ko.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "개 휘파람 단어",
"Content warnings will be added for the following": "다음에 대한 콘텐츠 경고가 추가됩니다.",
"nowplaying": "지금 재생",
- "NowPlaying": "지금 재생"
+ "NowPlaying": "지금 재생",
+ "Import and Export": "가져오기 및 내보내기"
}
diff --git a/translations/ku.json b/translations/ku.json
index c525bc6ad..47b2996ea 100644
--- a/translations/ku.json
+++ b/translations/ku.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "Peyvên kûçikê",
"Content warnings will be added for the following": "Hişyariyên naverokê dê ji bo jêrîn werin zêdekirin",
"nowplaying": "nihadilîze",
- "NowPlaying": "NihaDilîze"
+ "NowPlaying": "NihaDilîze",
+ "Import and Export": "Import û Export"
}
diff --git a/translations/nl.json b/translations/nl.json
index cda50afe5..a237c02ce 100644
--- a/translations/nl.json
+++ b/translations/nl.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "Hondenfluitwoorden",
"Content warnings will be added for the following": "Er worden inhoudswaarschuwingen toegevoegd voor het volgende:",
"nowplaying": "nuaanhetspelen",
- "NowPlaying": "NuAanHetSpelen"
+ "NowPlaying": "NuAanHetSpelen",
+ "Import and Export": "Importeren en exporteren"
}
diff --git a/translations/oc.json b/translations/oc.json
index 230d0687a..aade46efe 100644
--- a/translations/oc.json
+++ b/translations/oc.json
@@ -565,5 +565,6 @@
"Dogwhistle words": "Dogwhistle words",
"Content warnings will be added for the following": "Content warnings will be added for the following",
"nowplaying": "nowplaying",
- "NowPlaying": "NowPlaying"
+ "NowPlaying": "NowPlaying",
+ "Import and Export": "Import and Export"
}
diff --git a/translations/pl.json b/translations/pl.json
index be83884b3..a101196e7 100644
--- a/translations/pl.json
+++ b/translations/pl.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "Słowa gwizdka na psa",
"Content warnings will be added for the following": "Ostrzeżenia dotyczące treści zostaną dodane do następujących",
"nowplaying": "terazgra",
- "NowPlaying": "TerazGra"
+ "NowPlaying": "TerazGra",
+ "Import and Export": "Importuj i eksportuj"
}
diff --git a/translations/pt.json b/translations/pt.json
index f016d3336..7b3890038 100644
--- a/translations/pt.json
+++ b/translations/pt.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "Palavras de apito",
"Content warnings will be added for the following": "Avisos de conteúdo serão adicionados para os seguintes",
"nowplaying": "agorajogando",
- "NowPlaying": "AgoraJogando"
+ "NowPlaying": "AgoraJogando",
+ "Import and Export": "Importar e exportar"
}
diff --git a/translations/ru.json b/translations/ru.json
index 3acc75209..bd64a7eab 100644
--- a/translations/ru.json
+++ b/translations/ru.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "Собачий свисток",
"Content warnings will be added for the following": "Предупреждения о содержании будут добавлены для следующих",
"nowplaying": "сейчасиграет",
- "NowPlaying": "СейчасИграет"
+ "NowPlaying": "СейчасИграет",
+ "Import and Export": "Импорт и экспорт"
}
diff --git a/translations/sw.json b/translations/sw.json
index da1ca0dfe..e24ca61a5 100644
--- a/translations/sw.json
+++ b/translations/sw.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "Maneno ya mbwa",
"Content warnings will be added for the following": "Maonyo ya maudhui yataongezwa kwa yafuatayo",
"nowplaying": "inachezasasa",
- "NowPlaying": "InachezaSasa"
+ "NowPlaying": "InachezaSasa",
+ "Import and Export": "Ingiza na Hamisha"
}
diff --git a/translations/tr.json b/translations/tr.json
index 3f3794f12..fc195d6b0 100644
--- a/translations/tr.json
+++ b/translations/tr.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "İtiraf sözleri",
"Content warnings will be added for the following": "Aşağıdakiler için içerik uyarıları eklenecek",
"nowplaying": "şimdioynuyor",
- "NowPlaying": "ŞimdiOynuyor"
+ "NowPlaying": "ŞimdiOynuyor",
+ "Import and Export": "İthalat ve ihracat"
}
diff --git a/translations/uk.json b/translations/uk.json
index 51fa2a718..202ea9d55 100644
--- a/translations/uk.json
+++ b/translations/uk.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "Собачі слова",
"Content warnings will be added for the following": "Попередження про вміст буде додано для наступних",
"nowplaying": "заразграє",
- "NowPlaying": "ЗаразГрає"
+ "NowPlaying": "ЗаразГрає",
+ "Import and Export": "Імпорт та експорт"
}
diff --git a/translations/yi.json b/translations/yi.json
index e21409988..33a188989 100644
--- a/translations/yi.json
+++ b/translations/yi.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "דאָגווהיסטלע ווערטער",
"Content warnings will be added for the following": "אינהאַלט וואָרנינגז וועט זיין מוסיף פֿאַר די פאלגענדע",
"nowplaying": "איצט פּלייַינג",
- "NowPlaying": "איצט פּלייַינג"
+ "NowPlaying": "איצט פּלייַינג",
+ "Import and Export": "אַרייַנפיר און עקספּאָרט"
}
diff --git a/translations/zh.json b/translations/zh.json
index 05740f4df..928ce8e37 100644
--- a/translations/zh.json
+++ b/translations/zh.json
@@ -569,5 +569,6 @@
"Dogwhistle words": "狗哨的话",
"Content warnings will be added for the following": "将为以下内容添加内容警告",
"nowplaying": "现在玩",
- "NowPlaying": "现在玩"
+ "NowPlaying": "现在玩",
+ "Import and Export": "进出口"
}
diff --git a/webapp_profile.py b/webapp_profile.py
index 348fbeebb..70a739a85 100644
--- a/webapp_profile.py
+++ b/webapp_profile.py
@@ -1982,7 +1982,6 @@ def _html_edit_profile_contact_info(nickname: str,
"""Contact Information section of edit profile screen
"""
edit_profile_form = begin_edit_section(translate['Contact Details'])
-
edit_profile_form += edit_text_field(translate['Email'],
'email', email_address)
edit_profile_form += edit_text_field(translate['XMPP'],
@@ -1995,11 +1994,27 @@ def _html_edit_profile_contact_info(nickname: str,
briar_address)
edit_profile_form += edit_text_field('Cwtch', 'cwtchAddress',
cwtch_address)
- edit_profile_form += \
- '
\n'
+ edit_profile_form += end_edit_section()
+ return edit_profile_form
+
+def _html_edit_profile_import_export(nickname: str, domain: str,
+ translate: {}) -> str:
+ """Contact Information section of edit profile screen
+ """
+ edit_profile_form = begin_edit_section(translate['Import and Export'])
+ edit_profile_form += \
+ '
' + edit_profile_form += \ + ' ' + \ + '
\n' + edit_profile_form += \ + '\n' edit_profile_form += end_edit_section() return edit_profile_form @@ -2404,6 +2419,10 @@ def html_edit_profile(server, translate: {}, briar_address, cwtch_address, translate) + # Import and export + edit_profile_form += \ + _html_edit_profile_import_export(nickname, domain, translate) + # Encryption Keys edit_profile_form += \ _html_edit_profile_encryption_keys(pgp_fingerprint, diff --git a/webapp_utils.py b/webapp_utils.py index e9effca61..901dd0d11 100644 --- a/webapp_utils.py +++ b/webapp_utils.py @@ -99,6 +99,26 @@ def html_following_list(base_dir: str, following_filename: str) -> str: return '' +def csv_following_list(following_filename: str) -> str: + """Returns a csv of handles being followed + """ + with open(following_filename, 'r', encoding='utf-8') as following_file: + msg = following_file.read() + following_list = msg.split('\n') + following_list.sort() + if following_list: + following_list_csv = '' + for following_address in following_list: + if not following_address: + continue + if following_list_csv: + following_list_csv += '\n' + following_list_csv += following_address + ',true' + msg = 'Account address,Show boosts\n' + following_list_csv + return msg + return '' + + def html_hashtag_blocked(base_dir: str, translate: {}) -> str: """Show the screen for a blocked hashtag """