mirror of https://gitlab.com/bashrc2/epicyon
List of urls
parent
146d1413c3
commit
b5349762b4
20
posts.py
20
posts.py
|
@ -547,11 +547,13 @@ def getPostsForBlockedDomains(baseDir: str,
|
|||
if isinstance(item['object']['inReplyTo'], str):
|
||||
postDomain, postPort = \
|
||||
getDomainFromActor(item['object']['inReplyTo'])
|
||||
if isBlockedDomain(baseDir, postDomain):
|
||||
if isBlockedDomain(baseDir, postDomain) and \
|
||||
item['object'].get('url'):
|
||||
url = item['object']['url']
|
||||
if not blockedPosts.get(postDomain):
|
||||
blockedPosts[postDomain] = [item]
|
||||
blockedPosts[postDomain] = [url]
|
||||
else:
|
||||
blockedPosts[postDomain].append(item)
|
||||
blockedPosts[postDomain].append(url)
|
||||
|
||||
if item['object'].get('tag'):
|
||||
for tagItem in item['object']['tag']:
|
||||
|
@ -560,11 +562,13 @@ def getPostsForBlockedDomains(baseDir: str,
|
|||
if tagItem.get('href'):
|
||||
postDomain, postPort = \
|
||||
getDomainFromActor(tagItem['href'])
|
||||
if isBlockedDomain(baseDir, postDomain):
|
||||
if isBlockedDomain(baseDir, postDomain) and \
|
||||
item['object'].get('url'):
|
||||
url = item['object']['url']
|
||||
if not blockedPosts.get(postDomain):
|
||||
blockedPosts[postDomain] = [item]
|
||||
blockedPosts[postDomain] = [url]
|
||||
else:
|
||||
blockedPosts[postDomain].append(item)
|
||||
blockedPosts[postDomain].append(url)
|
||||
return blockedPosts
|
||||
|
||||
|
||||
|
@ -3456,10 +3460,10 @@ def getPublicPostInfo(session, baseDir: str, nickname: str, domain: str,
|
|||
debug,
|
||||
projectVersion, httpPrefix,
|
||||
domain)
|
||||
for blockedDomain, postList in blockedPosts.items():
|
||||
for blockedDomain, postUrlList in blockedPosts.items():
|
||||
if not domainsInfo.get(blockedDomain):
|
||||
continue
|
||||
domainsInfo[blockedDomain] = postList.copy()
|
||||
domainsInfo[blockedDomain] += postUrlList
|
||||
|
||||
return domainsInfo
|
||||
|
||||
|
|
|
@ -87,15 +87,12 @@ def htmlAccountInfo(cssCache: {}, translate: {},
|
|||
infoForm += '<div class="accountInfoDomains">'
|
||||
usersPath = '/users/' + nickname + '/accountinfo'
|
||||
ctr = 1
|
||||
for postDomain, blockedPosts in domainDict.items():
|
||||
for postDomain, blockedPostUrls in domainDict.items():
|
||||
infoForm += '<a href="' + \
|
||||
httpPrefix + '://' + postDomain + '">' + postDomain + '</a> '
|
||||
if isBlockedDomain(baseDir, postDomain):
|
||||
blockedPostsLinks = ''
|
||||
for blockedPostJson in blockedPosts:
|
||||
if not blockedPostJson['object'].get('url'):
|
||||
continue
|
||||
url = blockedPostJson['object']['url']
|
||||
for url in blockedPostUrls:
|
||||
blockedPostsLinks += \
|
||||
'<a href="' + url + '">' + url + '</a><br>'
|
||||
blockedPostsHtml = ''
|
||||
|
|
Loading…
Reference in New Issue