Show follows you status on person options

alt-html-css
Bob Mottram 2021-01-02 11:37:24 +00:00
parent a9fcabd366
commit 03044b9819
17 changed files with 44 additions and 20 deletions

View File

@ -175,8 +175,8 @@ def followerOfPerson(baseDir: str, nickname: str, domain: str,
federationList, debug, 'followers.txt') federationList, debug, 'followers.txt')
def _isFollowerOfPerson(baseDir: str, nickname: str, domain: str, def isFollowerOfPerson(baseDir: str, nickname: str, domain: str,
followerNickname: str, followerDomain: str) -> bool: followerNickname: str, followerDomain: str) -> bool:
"""is the given nickname a follower of followerNickname? """is the given nickname a follower of followerNickname?
""" """
if ':' in domain: if ':' in domain:
@ -663,9 +663,9 @@ def receiveFollowRequest(session, baseDir: str, httpPrefix: str,
baseDir + '/accounts/' + handleToFollow) baseDir + '/accounts/' + handleToFollow)
return True return True
if _isFollowerOfPerson(baseDir, if isFollowerOfPerson(baseDir,
nicknameToFollow, domainToFollowFull, nicknameToFollow, domainToFollowFull,
nickname, domainFull): nickname, domainFull):
if debug: if debug:
print('DEBUG: ' + nickname + '@' + domain + print('DEBUG: ' + nickname + '@' + domain +
' is already a follower of ' + ' is already a follower of ' +

View File

@ -349,5 +349,6 @@
"Unfilter words": "الكلمات غير المصفاة", "Unfilter words": "الكلمات غير المصفاة",
"Show Accounts": "إظهار الحسابات", "Show Accounts": "إظهار الحسابات",
"Peertube Instances": "مثيلات Peertube", "Peertube Instances": "مثيلات Peertube",
"Show video previews for the following Peertube sites.": "إظهار معاينات الفيديو لمواقع Peertube التالية." "Show video previews for the following Peertube sites.": "إظهار معاينات الفيديو لمواقع Peertube التالية.",
"Follows you": "يتبعك"
} }

View File

@ -349,5 +349,6 @@
"Unfilter words": "Paraules sense filtre", "Unfilter words": "Paraules sense filtre",
"Show Accounts": "Mostra comptes", "Show Accounts": "Mostra comptes",
"Peertube Instances": "Instàncies de Peertube", "Peertube Instances": "Instàncies de Peertube",
"Show video previews for the following Peertube sites.": "Mostra les previsualitzacions de vídeo dels següents llocs de Peertube." "Show video previews for the following Peertube sites.": "Mostra les previsualitzacions de vídeo dels següents llocs de Peertube.",
"Follows you": "Et segueix"
} }

View File

@ -349,5 +349,6 @@
"Unfilter words": "Geiriau di-hid", "Unfilter words": "Geiriau di-hid",
"Show Accounts": "Dangos Cyfrifon", "Show Accounts": "Dangos Cyfrifon",
"Peertube Instances": "Camau Peertube", "Peertube Instances": "Camau Peertube",
"Show video previews for the following Peertube sites.": "Dangos rhagolygon fideo ar gyfer y safleoedd Peertube canlynol." "Show video previews for the following Peertube sites.": "Dangos rhagolygon fideo ar gyfer y safleoedd Peertube canlynol.",
"Follows you": "Yn eich dilyn chi"
} }

View File

@ -349,5 +349,6 @@
"Unfilter words": "Wörter herausfiltern", "Unfilter words": "Wörter herausfiltern",
"Show Accounts": "Konten anzeigen", "Show Accounts": "Konten anzeigen",
"Peertube Instances": "Peertube-Instanzen", "Peertube Instances": "Peertube-Instanzen",
"Show video previews for the following Peertube sites.": "Zeigen Sie eine Videovorschau für die folgenden Peertube-Websites an." "Show video previews for the following Peertube sites.": "Zeigen Sie eine Videovorschau für die folgenden Peertube-Websites an.",
"Follows you": "Folgt dir"
} }

View File

@ -349,5 +349,6 @@
"Unfilter words": "Unfilter words", "Unfilter words": "Unfilter words",
"Show Accounts": "Show Accounts", "Show Accounts": "Show Accounts",
"Peertube Instances": "Peertube Instances", "Peertube Instances": "Peertube Instances",
"Show video previews for the following Peertube sites.": "Show video previews for the following Peertube sites." "Show video previews for the following Peertube sites.": "Show video previews for the following Peertube sites.",
"Follows you": "Follows you"
} }

View File

@ -349,5 +349,6 @@
"Unfilter words": "Palabras sin filtrar", "Unfilter words": "Palabras sin filtrar",
"Show Accounts": "Mostrar cuentas", "Show Accounts": "Mostrar cuentas",
"Peertube Instances": "Instancias de Peertube", "Peertube Instances": "Instancias de Peertube",
"Show video previews for the following Peertube sites.": "Muestre vistas previas de video para los siguientes sitios de Peertube." "Show video previews for the following Peertube sites.": "Muestre vistas previas de video para los siguientes sitios de Peertube.",
"Follows you": "Te sigue"
} }

View File

@ -349,5 +349,6 @@
"Unfilter words": "Mots non filtrés", "Unfilter words": "Mots non filtrés",
"Show Accounts": "Afficher les comptes", "Show Accounts": "Afficher les comptes",
"Peertube Instances": "Instances Peertube", "Peertube Instances": "Instances Peertube",
"Show video previews for the following Peertube sites.": "Afficher des aperçus vidéo pour les sites Peertube suivants." "Show video previews for the following Peertube sites.": "Afficher des aperçus vidéo pour les sites Peertube suivants.",
"Follows you": "Vous suit"
} }

View File

@ -349,5 +349,6 @@
"Unfilter words": "Focail neamhleithleacha", "Unfilter words": "Focail neamhleithleacha",
"Show Accounts": "Taispeáin Cuntais", "Show Accounts": "Taispeáin Cuntais",
"Peertube Instances": "Imeachtaí Peertube", "Peertube Instances": "Imeachtaí Peertube",
"Show video previews for the following Peertube sites.": "Taispeáin réamhamharcanna físe do na suíomhanna Peertube seo a leanas." "Show video previews for the following Peertube sites.": "Taispeáin réamhamharcanna físe do na suíomhanna Peertube seo a leanas.",
"Follows you": "Leanann tú"
} }

View File

@ -349,5 +349,6 @@
"Unfilter words": "अनफ़िल्टर शब्द", "Unfilter words": "अनफ़िल्टर शब्द",
"Show Accounts": "खाते दिखाएं", "Show Accounts": "खाते दिखाएं",
"Peertube Instances": "Peertube उदाहरण", "Peertube Instances": "Peertube उदाहरण",
"Show video previews for the following Peertube sites.": "निम्नलिखित Peertube साइटों के लिए वीडियो पूर्वावलोकन दिखाएं।" "Show video previews for the following Peertube sites.": "निम्नलिखित Peertube साइटों के लिए वीडियो पूर्वावलोकन दिखाएं।",
"Follows you": "आपका पीछा करता है"
} }

View File

@ -349,5 +349,6 @@
"Unfilter words": "Parole non filtrate", "Unfilter words": "Parole non filtrate",
"Show Accounts": "Mostra account", "Show Accounts": "Mostra account",
"Peertube Instances": "Istanze di Peertube", "Peertube Instances": "Istanze di Peertube",
"Show video previews for the following Peertube sites.": "Mostra le anteprime dei video per i seguenti siti Peertube." "Show video previews for the following Peertube sites.": "Mostra le anteprime dei video per i seguenti siti Peertube.",
"Follows you": "Ti segue"
} }

View File

@ -349,5 +349,6 @@
"Unfilter words": "単語のフィルタリングを解除する", "Unfilter words": "単語のフィルタリングを解除する",
"Show Accounts": "アカウントを表示する", "Show Accounts": "アカウントを表示する",
"Peertube Instances": "Peertubeインスタンス", "Peertube Instances": "Peertubeインスタンス",
"Show video previews for the following Peertube sites.": "次のPeertubeサイトのビデオプレビューを表示します。" "Show video previews for the following Peertube sites.": "次のPeertubeサイトのビデオプレビューを表示します。",
"Follows you": "あなたについていきます"
} }

View File

@ -345,5 +345,6 @@
"Unfilter words": "Unfilter words", "Unfilter words": "Unfilter words",
"Show Accounts": "Show Accounts", "Show Accounts": "Show Accounts",
"Peertube Instances": "Peertube Instances", "Peertube Instances": "Peertube Instances",
"Show video previews for the following Peertube sites.": "Show video previews for the following Peertube sites." "Show video previews for the following Peertube sites.": "Show video previews for the following Peertube sites.",
"Follows you": "Follows you"
} }

View File

@ -349,5 +349,6 @@
"Unfilter words": "Palavras sem filtro", "Unfilter words": "Palavras sem filtro",
"Show Accounts": "Mostrar contas", "Show Accounts": "Mostrar contas",
"Peertube Instances": "Instâncias Peertube", "Peertube Instances": "Instâncias Peertube",
"Show video previews for the following Peertube sites.": "Mostrar visualizações de vídeo para os seguintes sites Peertube." "Show video previews for the following Peertube sites.": "Mostrar visualizações de vídeo para os seguintes sites Peertube.",
"Follows you": "Segue você"
} }

View File

@ -349,5 +349,6 @@
"Unfilter words": "Не фильтровать слова", "Unfilter words": "Не фильтровать слова",
"Show Accounts": "Показать счета", "Show Accounts": "Показать счета",
"Peertube Instances": "Экземпляры Peertube", "Peertube Instances": "Экземпляры Peertube",
"Show video previews for the following Peertube sites.": "Показать превью видео для следующих сайтов Peertube." "Show video previews for the following Peertube sites.": "Показать превью видео для следующих сайтов Peertube.",
"Follows you": "Следует за вами"
} }

View File

@ -349,5 +349,6 @@
"Unfilter words": "未过滤字词", "Unfilter words": "未过滤字词",
"Show Accounts": "显示帐户", "Show Accounts": "显示帐户",
"Peertube Instances": "Peertube实例", "Peertube Instances": "Peertube实例",
"Show video previews for the following Peertube sites.": "显示以下Peertube网站的视频预览。" "Show video previews for the following Peertube sites.": "显示以下Peertube网站的视频预览。",
"Follows you": "跟着你"
} }

View File

@ -18,6 +18,7 @@ from utils import removeHtml
from utils import getDomainFromActor from utils import getDomainFromActor
from utils import getNicknameFromActor from utils import getNicknameFromActor
from blocking import isBlocked from blocking import isBlocked
from follow import isFollowerOfPerson
from follow import isFollowingActor from follow import isFollowingActor
from followingCalendar import receivingCalendarEvents from followingCalendar import receivingCalendarEvents
from webapp_utils import htmlHeaderWithExternalStyle from webapp_utils import htmlHeaderWithExternalStyle
@ -62,6 +63,7 @@ def htmlPersonOptions(defaultTimeline: str,
blockStr = 'Block' blockStr = 'Block'
nickname = None nickname = None
optionsNickname = None optionsNickname = None
followsYou = False
if originPathStr.startswith('/users/'): if originPathStr.startswith('/users/'):
nickname = originPathStr.split('/users/')[1] nickname = originPathStr.split('/users/')[1]
if '/' in nickname: if '/' in nickname:
@ -77,6 +79,10 @@ def htmlPersonOptions(defaultTimeline: str,
optionsNickname = getNicknameFromActor(optionsActor) optionsNickname = getNicknameFromActor(optionsActor)
optionsDomainFull = getFullDomain(optionsDomain, optionsPort) optionsDomainFull = getFullDomain(optionsDomain, optionsPort)
followsYou = \
isFollowerOfPerson(baseDir,
nickname, domain,
optionsNickname, optionsDomainFull)
if isBlocked(baseDir, nickname, domain, if isBlocked(baseDir, nickname, domain,
optionsNickname, optionsDomainFull): optionsNickname, optionsDomainFull):
blockStr = 'Block' blockStr = 'Block'
@ -120,6 +126,9 @@ def htmlPersonOptions(defaultTimeline: str,
optionsStr += \ optionsStr += \
' <p class="optionsText">' + translate['Options for'] + \ ' <p class="optionsText">' + translate['Options for'] + \
' @' + handleShown + '</p>\n' ' @' + handleShown + '</p>\n'
if followsYou:
optionsStr += \
' <p class="optionsText">' + translate['Follows you'] + '</p>\n'
if emailAddress: if emailAddress:
optionsStr += \ optionsStr += \
'<p class="imText">' + translate['Email'] + \ '<p class="imText">' + translate['Email'] + \