mirror of https://gitlab.com/bashrc2/epicyon
Show dormant status on person options screen
parent
e4c34ec6ad
commit
9ed343865d
|
@ -4987,7 +4987,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
ssbAddress, blogAddress,
|
ssbAddress, blogAddress,
|
||||||
toxAddress, jamiAddress,
|
toxAddress, jamiAddress,
|
||||||
PGPpubKey, PGPfingerprint,
|
PGPpubKey, PGPfingerprint,
|
||||||
emailAddress).encode('utf-8')
|
emailAddress,
|
||||||
|
self.server.dormantMonths).encode('utf-8')
|
||||||
self._set_headers('text/html', len(msg),
|
self._set_headers('text/html', len(msg),
|
||||||
cookie, callingDomain)
|
cookie, callingDomain)
|
||||||
self._write(msg)
|
self._write(msg)
|
||||||
|
|
|
@ -11,6 +11,7 @@ from shutil import copyfile
|
||||||
from petnames import getPetName
|
from petnames import getPetName
|
||||||
from person import isPersonSnoozed
|
from person import isPersonSnoozed
|
||||||
from posts import isModerator
|
from posts import isModerator
|
||||||
|
from utils import isDormant
|
||||||
from utils import removeHtml
|
from utils import removeHtml
|
||||||
from utils import getDomainFromActor
|
from utils import getDomainFromActor
|
||||||
from utils import getNicknameFromActor
|
from utils import getNicknameFromActor
|
||||||
|
@ -39,7 +40,8 @@ def htmlPersonOptions(defaultTimeline: str,
|
||||||
jamiAddress: str,
|
jamiAddress: str,
|
||||||
PGPpubKey: str,
|
PGPpubKey: str,
|
||||||
PGPfingerprint: str,
|
PGPfingerprint: str,
|
||||||
emailAddress) -> str:
|
emailAddress: str,
|
||||||
|
dormantMonths: int) -> str:
|
||||||
"""Show options for a person: view/follow/block/report
|
"""Show options for a person: view/follow/block/report
|
||||||
"""
|
"""
|
||||||
optionsDomain, optionsPort = getDomainFromActor(optionsActor)
|
optionsDomain, optionsPort = getDomainFromActor(optionsActor)
|
||||||
|
@ -53,6 +55,7 @@ def htmlPersonOptions(defaultTimeline: str,
|
||||||
copyfile(baseDir + '/accounts/options-background.jpg',
|
copyfile(baseDir + '/accounts/options-background.jpg',
|
||||||
baseDir + '/accounts/options-background.jpg')
|
baseDir + '/accounts/options-background.jpg')
|
||||||
|
|
||||||
|
dormant = False
|
||||||
followStr = 'Follow'
|
followStr = 'Follow'
|
||||||
blockStr = 'Block'
|
blockStr = 'Block'
|
||||||
nickname = None
|
nickname = None
|
||||||
|
@ -66,6 +69,9 @@ def htmlPersonOptions(defaultTimeline: str,
|
||||||
followerDomain, followerPort = getDomainFromActor(optionsActor)
|
followerDomain, followerPort = getDomainFromActor(optionsActor)
|
||||||
if isFollowingActor(baseDir, nickname, domain, optionsActor):
|
if isFollowingActor(baseDir, nickname, domain, optionsActor):
|
||||||
followStr = 'Unfollow'
|
followStr = 'Unfollow'
|
||||||
|
dormant = \
|
||||||
|
isDormant(baseDir, nickname, domain, optionsActor,
|
||||||
|
dormantMonths)
|
||||||
|
|
||||||
optionsNickname = getNicknameFromActor(optionsActor)
|
optionsNickname = getNicknameFromActor(optionsActor)
|
||||||
optionsDomainFull = optionsDomain
|
optionsDomainFull = optionsDomain
|
||||||
|
@ -107,9 +113,12 @@ def htmlPersonOptions(defaultTimeline: str,
|
||||||
optionsStr += ' <img loading="lazy" src="' + optionsProfileUrl + \
|
optionsStr += ' <img loading="lazy" src="' + optionsProfileUrl + \
|
||||||
'" ' + getBrokenLinkSubstitute() + '/></a>\n'
|
'" ' + getBrokenLinkSubstitute() + '/></a>\n'
|
||||||
handle = getNicknameFromActor(optionsActor) + '@' + optionsDomain
|
handle = getNicknameFromActor(optionsActor) + '@' + optionsDomain
|
||||||
|
handleShown = handle
|
||||||
|
if dormant:
|
||||||
|
handleShown += '💤'
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
' <p class="optionsText">' + translate['Options for'] + \
|
' <p class="optionsText">' + translate['Options for'] + \
|
||||||
' @' + handle + '</p>\n'
|
' @' + handleShown + '</p>\n'
|
||||||
if emailAddress:
|
if emailAddress:
|
||||||
optionsStr += \
|
optionsStr += \
|
||||||
'<p class="imText">' + translate['Email'] + \
|
'<p class="imText">' + translate['Email'] + \
|
||||||
|
|
Loading…
Reference in New Issue