From 5d2b7c40f9b412c03fa63628b2654694e3f5ab12 Mon Sep 17 00:00:00 2001
From: Bob Mottram
Date: Tue, 19 Jul 2022 14:31:13 +0100
Subject: [PATCH 1/5] Also list followers
---
daemon.py | 26 ++++++++++++++++++++++++++
webapp_profile.py | 6 +++++-
2 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/daemon.py b/daemon.py
index 0dc3d98e7..badf8c9d7 100644
--- a/daemon.py
+++ b/daemon.py
@@ -16393,6 +16393,32 @@ class PubServer(BaseHTTPRequestHandler):
'_GET', 'following accounts done',
self.server.debug)
+ # show a list of who are your followers
+ if html_getreq and 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
+ 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'))
+ 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/webapp_profile.py b/webapp_profile.py
index 348fbeebb..27956e038 100644
--- a/webapp_profile.py
+++ b/webapp_profile.py
@@ -1998,7 +1998,11 @@ def _html_edit_profile_contact_info(nickname: str,
edit_profile_form += \
'
\n'
+ translate['Following'] + ' '
+ edit_profile_form += \
+ '
\n'
edit_profile_form += end_edit_section()
return edit_profile_form
From 89298477aa7c65c4a420d035ad72d7bdca0d5d8b Mon Sep 17 00:00:00 2001
From: Bob Mottram
Date: Tue, 19 Jul 2022 14:34:10 +0100
Subject: [PATCH 2/5] Separator
---
webapp_profile.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/webapp_profile.py b/webapp_profile.py
index 27956e038..82988bd02 100644
--- a/webapp_profile.py
+++ b/webapp_profile.py
@@ -1998,7 +1998,7 @@ def _html_edit_profile_contact_info(nickname: str,
edit_profile_form += \
' '
+ translate['Following'] + ' | '
edit_profile_form += \
''
edit_profile_form += \
- '' + \
+ '⇩ CSV'
+ edit_profile_form += \
+ ' | ' + \
translate['Followers'] + '
\n'
@@ -2402,7 +2406,7 @@ def html_edit_profile(server, translate: {},
# Contact information
edit_profile_form += \
- _html_edit_profile_contact_info(nickname, email_address,
+ _html_edit_profile_contact_info(nickname, domain, email_address,
xmpp_address, matrix_address,
ssb_address, tox_address,
briar_address,
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
"""
From 854d0dc25c5c9717e40928714c13b0e1a58b612f Mon Sep 17 00:00:00 2001
From: Bob Mottram
Date: Wed, 20 Jul 2022 14:35:22 +0100
Subject: [PATCH 5/5] Import and export section within profile
---
translations/ar.json | 3 ++-
translations/bn.json | 3 ++-
translations/ca.json | 3 ++-
translations/cy.json | 3 ++-
translations/de.json | 3 ++-
translations/el.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/ko.json | 3 ++-
translations/ku.json | 3 ++-
translations/nl.json | 3 ++-
translations/oc.json | 3 ++-
translations/pl.json | 3 ++-
translations/pt.json | 3 ++-
translations/ru.json | 3 ++-
translations/sw.json | 3 ++-
translations/tr.json | 3 ++-
translations/uk.json | 3 ++-
translations/yi.json | 3 ++-
translations/zh.json | 3 ++-
webapp_profile.py | 27 +++++++++++++++++++--------
26 files changed, 69 insertions(+), 33 deletions(-)
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 ee60fe7d9..70a739a85 100644
--- a/webapp_profile.py
+++ b/webapp_profile.py
@@ -1970,7 +1970,7 @@ def _html_edit_profile_background(news_instance: bool, translate: {}) -> str:
return edit_profile_form
-def _html_edit_profile_contact_info(nickname: str, domain: str,
+def _html_edit_profile_contact_info(nickname: str,
email_address: str,
xmpp_address: str,
matrix_address: str,
@@ -1982,7 +1982,6 @@ def _html_edit_profile_contact_info(nickname: str, domain: 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,19 +1994,27 @@ def _html_edit_profile_contact_info(nickname: str, domain: str,
briar_address)
edit_profile_form += edit_text_field('Cwtch', 'cwtchAddress',
cwtch_address)
+ 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 += \
- '' + \
translate['Following'] + ''
edit_profile_form += \
' ' + \
- '⇩ CSV'
+ '⇩ CSV
\n'
edit_profile_form += \
- ' | ' + \
- translate['Followers'] + '
\n'
-
+ translate['Followers'] + '
\n'
edit_profile_form += end_edit_section()
return edit_profile_form
@@ -2406,12 +2413,16 @@ def html_edit_profile(server, translate: {},
# Contact information
edit_profile_form += \
- _html_edit_profile_contact_info(nickname, domain, email_address,
+ _html_edit_profile_contact_info(nickname, email_address,
xmpp_address, matrix_address,
ssb_address, tox_address,
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,