diff --git a/daemon.py b/daemon.py index 8ae2d41ab..3002e21c7 100644 --- a/daemon.py +++ b/daemon.py @@ -4987,7 +4987,8 @@ class PubServer(BaseHTTPRequestHandler): ssbAddress, blogAddress, toxAddress, jamiAddress, PGPpubKey, PGPfingerprint, - emailAddress).encode('utf-8') + emailAddress, + self.server.dormantMonths).encode('utf-8') self._set_headers('text/html', len(msg), cookie, callingDomain) self._write(msg) diff --git a/webapp_person_options.py b/webapp_person_options.py index aa60ed3e1..f6f098e81 100644 --- a/webapp_person_options.py +++ b/webapp_person_options.py @@ -11,6 +11,7 @@ from shutil import copyfile from petnames import getPetName from person import isPersonSnoozed from posts import isModerator +from utils import isDormant from utils import removeHtml from utils import getDomainFromActor from utils import getNicknameFromActor @@ -39,7 +40,8 @@ def htmlPersonOptions(defaultTimeline: str, jamiAddress: str, PGPpubKey: str, PGPfingerprint: str, - emailAddress) -> str: + emailAddress: str, + dormantMonths: int) -> str: """Show options for a person: view/follow/block/report """ optionsDomain, optionsPort = getDomainFromActor(optionsActor) @@ -53,6 +55,7 @@ def htmlPersonOptions(defaultTimeline: str, copyfile(baseDir + '/accounts/options-background.jpg', baseDir + '/accounts/options-background.jpg') + dormant = False followStr = 'Follow' blockStr = 'Block' nickname = None @@ -66,6 +69,9 @@ def htmlPersonOptions(defaultTimeline: str, followerDomain, followerPort = getDomainFromActor(optionsActor) if isFollowingActor(baseDir, nickname, domain, optionsActor): followStr = 'Unfollow' + dormant = \ + isDormant(baseDir, nickname, domain, optionsActor, + dormantMonths) optionsNickname = getNicknameFromActor(optionsActor) optionsDomainFull = optionsDomain @@ -107,9 +113,12 @@ def htmlPersonOptions(defaultTimeline: str, optionsStr += ' \n' handle = getNicknameFromActor(optionsActor) + '@' + optionsDomain + handleShown = handle + if dormant: + handleShown += '💤' optionsStr += \ '
\n' + ' @' + handleShown + '\n' if emailAddress: optionsStr += \ '' + translate['Email'] + \