diff --git a/daemon.py b/daemon.py index 9f471794..2d1ec172 100644 --- a/daemon.py +++ b/daemon.py @@ -47,7 +47,6 @@ from matrix import getMatrixAddress from matrix import setMatrixAddress from donate import getDonationUrl from donate import setDonationUrl -from person import getLockedAccount from person import setPersonNotes from person import getDefaultPersonContext from person import savePersonQrcode @@ -178,6 +177,7 @@ from shares import addShare from shares import removeShare from shares import expireShares from categories import setHashtagCategory +from utils import getLockedAccount from utils import hasUsersPath from utils import getFullDomain from utils import removeHtml diff --git a/person.py b/person.py index 8cf6a051..b7e80061 100644 --- a/person.py +++ b/person.py @@ -201,16 +201,6 @@ def getDefaultPersonContext() -> str: } -def getLockedAccount(actorJson: {}) -> bool: - """Returns whether the given account requires follower approval - """ - if not actorJson.get('manuallyApprovesFollowers'): - return False - if actorJson['manuallyApprovesFollowers'] is True: - return True - return False - - def _createPersonBase(baseDir: str, nickname: str, domain: str, port: int, httpPrefix: str, saveToFile: bool, manualFollowerApproval: bool, diff --git a/utils.py b/utils.py index ad3e2edd..0187f86e 100644 --- a/utils.py +++ b/utils.py @@ -19,6 +19,16 @@ from calendar import monthrange from followingCalendar import addPersonToCalendar +def getLockedAccount(actorJson: {}) -> bool: + """Returns whether the given account requires follower approval + """ + if not actorJson.get('manuallyApprovesFollowers'): + return False + if actorJson['manuallyApprovesFollowers'] is True: + return True + return False + + def hasUsersPath(pathStr: str) -> bool: """Whether there is a /users/ path (or equivalent) in the given string """ diff --git a/webapp_profile.py b/webapp_profile.py index 4d6e2170..eb02b0b9 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -8,6 +8,7 @@ __status__ = "Production" import os from pprint import pprint +from utils import getLockedAccount from utils import hasUsersPath from utils import getFullDomain from utils import isDormant @@ -164,6 +165,11 @@ def htmlProfileAfterSearch(cssCache: {}, displayName = searchNickname if profileJson.get('name'): displayName = profileJson['name'] + + lockedAccount = getLockedAccount(profileJson) + if lockedAccount: + displayName += '🔒' + profileDescription = '' if profileJson.get('summary'): profileDescription = profileJson['summary']