diff --git a/webapp_person_options.py b/webapp_person_options.py index 7daf365b4..807465b95 100644 --- a/webapp_person_options.py +++ b/webapp_person_options.py @@ -142,7 +142,7 @@ def htmlPersonOptions(defaultTimeline: str, optionsStr += \ '
\n' + ': @' + newHandle + '\n' if emailAddress: optionsStr += \ '' + translate['Email'] + \ diff --git a/webapp_profile.py b/webapp_profile.py index b8a9426a7..31c3b32c4 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -170,6 +170,10 @@ def htmlProfileAfterSearch(cssCache: {}, lockedAccount = getLockedAccount(profileJson) if lockedAccount: displayName += '🔒' + movedTo = '' + if profileJson.get('movedTo'): + movedTo = profileJson['movedTo'] + displayName += ' ⌂' followsYou = \ isFollowerOfPerson(baseDir, @@ -233,7 +237,8 @@ def htmlProfileAfterSearch(cssCache: {}, translate, displayName, followsYou, profileDescriptionShort, - avatarUrl, imageUrl) + avatarUrl, imageUrl, + movedTo) domainFull = getFullDomain(domain, port) @@ -301,7 +306,7 @@ def _getProfileHeader(baseDir: str, nickname: str, domain: str, avatarDescription: str, profileDescriptionShort: str, loginButton: str, avatarUrl: str, - theme: str) -> str: + theme: str, movedTo: str) -> str: """The header of the profile screen, containing background image and avatar """ @@ -321,6 +326,15 @@ def _getProfileHeader(baseDir: str, nickname: str, domain: str, htmlStr += '
@' + nickname + '@' + domainFull + '
\n'
+ if movedTo:
+ newNickname = getNicknameFromActor(movedTo)
+ newDomain, newPort = getDomainFromActor(movedTo)
+ newDomainFull = getFullDomain(newDomain, newPort)
+ if newNickname and newDomain:
+ htmlStr += \
+ '
' + translate['New account'] + ': ' + \
+ '@' + \
+ newNickname + '@' + newDomainFull + ' ' + translate['Follows you'] + ' ' + translate['New account'] + \
+ ': < a href="' + movedTo + '">@' + newHandle + '
\n'
htmlStr += \
' @' + searchNickname + '@' + searchDomainFull + '
\n'
if followsYou:
htmlStr += '
' + profileDescriptionShort + '
\n' htmlStr += ' \n' htmlStr += ' \n\n' @@ -588,6 +612,10 @@ def htmlProfile(rssIconAtTop: bool, avatarDescription = avatarDescription.replace('', '') avatarDescription = avatarDescription.replace('
', '') + movedTo = '' + if profileJson.get('movedTo'): + movedTo = profileJson['movedTo'] + avatarUrl = profileJson['icon']['url'] profileHeaderStr = \ _getProfileHeader(baseDir, nickname, domain, @@ -595,7 +623,8 @@ def htmlProfile(rssIconAtTop: bool, defaultTimeline, displayName, avatarDescription, profileDescriptionShort, - loginButton, avatarUrl, theme) + loginButton, avatarUrl, theme, + movedTo) profileStr = profileHeaderStr + donateSection profileStr += '