mirror of https://gitlab.com/bashrc2/epicyon
Get webfinger from cache
parent
7c177ad035
commit
7fbdb2445f
15
inbox.py
15
inbox.py
|
@ -157,14 +157,13 @@ def _inboxStorePostToHtmlCache(recentPostsCache: {}, maxRecentPosts: int,
|
|||
if boxname != 'tlevents' and boxname != 'outbox':
|
||||
boxname = 'inbox'
|
||||
|
||||
# wfRequest = {}
|
||||
# requestHandle = nickname + '@' + domain
|
||||
# if cachedWebfingers.get(requestHandle):
|
||||
# wfRequest = cachedWebfingers[requestHandle]
|
||||
# elif cachedWebfingers.get(requestHandle + ':' + str(port)):
|
||||
# wfRequest = cachedWebfingers[requestHandle + ':' + str(port)]
|
||||
# TODO: this may need to be changed
|
||||
wfRequest = cachedWebfingers
|
||||
# check if a cached version of the webfinger request exists
|
||||
requestHandle = nickname + '@' + getFullDomain(domain, port)
|
||||
if cachedWebfingers.get(requestHandle):
|
||||
wfRequest = cachedWebfingers[requestHandle]
|
||||
else:
|
||||
# TODO this may not be correct
|
||||
wfRequest = cachedWebfingers
|
||||
|
||||
individualPostAsHtml(True, recentPostsCache, maxRecentPosts,
|
||||
translate, pageNumber,
|
||||
|
|
8
posts.py
8
posts.py
|
@ -148,8 +148,12 @@ def getUserUrl(wfRequest: {}, sourceId=0) -> str:
|
|||
"""
|
||||
print('getUserUrl: ' + str(sourceId) + ' ' + str(wfRequest))
|
||||
if not wfRequest.get('links'):
|
||||
print('getUserUrl webfinger activity+json contains no links ' +
|
||||
str(sourceId) + ' ' + str(wfRequest))
|
||||
if sourceId == 72367:
|
||||
print('getUserUrl failed to get display name for webfinger ' +
|
||||
str(wfRequest))
|
||||
else:
|
||||
print('getUserUrl webfinger activity+json contains no links ' +
|
||||
str(sourceId) + ' ' + str(wfRequest))
|
||||
return None
|
||||
for link in wfRequest['links']:
|
||||
if not (link.get('type') and link.get('href')):
|
||||
|
|
|
@ -260,14 +260,13 @@ def htmlProfileAfterSearch(cssCache: {},
|
|||
if not item.get('object'):
|
||||
continue
|
||||
|
||||
# wfRequest = {}
|
||||
# requestHandle = nickname + '@' + domain
|
||||
# if cachedWebfingers.get(requestHandle):
|
||||
# wfRequest = cachedWebfingers[requestHandle]
|
||||
# elif cachedWebfingers.get(requestHandle + ':' + str(port)):
|
||||
# wfRequest = cachedWebfingers[requestHandle + ':' + str(port)]
|
||||
# TODO: this may need to be changed
|
||||
wfRequest = cachedWebfingers
|
||||
# check if a cached version of the webfinger request exists
|
||||
requestHandle = nickname + '@' + getFullDomain(domain, port)
|
||||
if cachedWebfingers.get(requestHandle):
|
||||
wfRequest = cachedWebfingers[requestHandle]
|
||||
else:
|
||||
# TODO this may not be correct
|
||||
wfRequest = cachedWebfingers
|
||||
|
||||
profileStr += \
|
||||
individualPostAsHtml(True, recentPostsCache, maxRecentPosts,
|
||||
|
|
Loading…
Reference in New Issue