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':
|
if boxname != 'tlevents' and boxname != 'outbox':
|
||||||
boxname = 'inbox'
|
boxname = 'inbox'
|
||||||
|
|
||||||
# wfRequest = {}
|
# check if a cached version of the webfinger request exists
|
||||||
# requestHandle = nickname + '@' + domain
|
requestHandle = nickname + '@' + getFullDomain(domain, port)
|
||||||
# if cachedWebfingers.get(requestHandle):
|
if cachedWebfingers.get(requestHandle):
|
||||||
# wfRequest = cachedWebfingers[requestHandle]
|
wfRequest = cachedWebfingers[requestHandle]
|
||||||
# elif cachedWebfingers.get(requestHandle + ':' + str(port)):
|
else:
|
||||||
# wfRequest = cachedWebfingers[requestHandle + ':' + str(port)]
|
# TODO this may not be correct
|
||||||
# TODO: this may need to be changed
|
wfRequest = cachedWebfingers
|
||||||
wfRequest = cachedWebfingers
|
|
||||||
|
|
||||||
individualPostAsHtml(True, recentPostsCache, maxRecentPosts,
|
individualPostAsHtml(True, recentPostsCache, maxRecentPosts,
|
||||||
translate, pageNumber,
|
translate, pageNumber,
|
||||||
|
|
8
posts.py
8
posts.py
|
@ -148,8 +148,12 @@ def getUserUrl(wfRequest: {}, sourceId=0) -> str:
|
||||||
"""
|
"""
|
||||||
print('getUserUrl: ' + str(sourceId) + ' ' + str(wfRequest))
|
print('getUserUrl: ' + str(sourceId) + ' ' + str(wfRequest))
|
||||||
if not wfRequest.get('links'):
|
if not wfRequest.get('links'):
|
||||||
print('getUserUrl webfinger activity+json contains no links ' +
|
if sourceId == 72367:
|
||||||
str(sourceId) + ' ' + str(wfRequest))
|
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
|
return None
|
||||||
for link in wfRequest['links']:
|
for link in wfRequest['links']:
|
||||||
if not (link.get('type') and link.get('href')):
|
if not (link.get('type') and link.get('href')):
|
||||||
|
|
|
@ -260,14 +260,13 @@ def htmlProfileAfterSearch(cssCache: {},
|
||||||
if not item.get('object'):
|
if not item.get('object'):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# wfRequest = {}
|
# check if a cached version of the webfinger request exists
|
||||||
# requestHandle = nickname + '@' + domain
|
requestHandle = nickname + '@' + getFullDomain(domain, port)
|
||||||
# if cachedWebfingers.get(requestHandle):
|
if cachedWebfingers.get(requestHandle):
|
||||||
# wfRequest = cachedWebfingers[requestHandle]
|
wfRequest = cachedWebfingers[requestHandle]
|
||||||
# elif cachedWebfingers.get(requestHandle + ':' + str(port)):
|
else:
|
||||||
# wfRequest = cachedWebfingers[requestHandle + ':' + str(port)]
|
# TODO this may not be correct
|
||||||
# TODO: this may need to be changed
|
wfRequest = cachedWebfingers
|
||||||
wfRequest = cachedWebfingers
|
|
||||||
|
|
||||||
profileStr += \
|
profileStr += \
|
||||||
individualPostAsHtml(True, recentPostsCache, maxRecentPosts,
|
individualPostAsHtml(True, recentPostsCache, maxRecentPosts,
|
||||||
|
|
Loading…
Reference in New Issue