Resolving the webfinger conundrum

alt-html-css
Bob Mottram 2020-12-31 12:23:15 +00:00
parent 8fb223e1aa
commit 1df8ed9c76
3 changed files with 6 additions and 20 deletions

View File

@ -157,17 +157,10 @@ def _inboxStorePostToHtmlCache(recentPostsCache: {}, maxRecentPosts: int,
if boxname != 'tlevents' and boxname != 'outbox':
boxname = 'inbox'
# 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,
baseDir, session, wfRequest, personCache,
baseDir, session, cachedWebfingers,
personCache,
nickname, domain, port, postJsonObject,
avatarUrl, True, allowDeletion,
httpPrefix, __version__, boxname, None,

View File

@ -1070,7 +1070,7 @@ def individualPostAsHtml(allowDownloads: bool,
recentPostsCache: {}, maxRecentPosts: int,
translate: {},
pageNumber: int, baseDir: str,
session, wfRequest: {}, personCache: {},
session, cachedWebfingers: {}, personCache: {},
nickname: str, domain: str, port: int,
postJsonObject: {},
avatarUrl: str, showAvatarOptions: bool,
@ -1155,7 +1155,8 @@ def individualPostAsHtml(allowDownloads: bool,
if domainFull not in postActor:
(inboxUrl, pubKeyId, pubKey,
fromPersonId, sharedInbox,
avatarUrl2, displayName) = getPersonBox(baseDir, session, wfRequest,
avatarUrl2, displayName) = getPersonBox(baseDir, session,
cachedWebfingers,
personCache,
projectVersion, httpPrefix,
nickname, domain, 'outbox',

View File

@ -260,18 +260,10 @@ def htmlProfileAfterSearch(cssCache: {},
if not item.get('object'):
continue
# 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,
translate, None, baseDir,
session, wfRequest, personCache,
session, cachedWebfingers, personCache,
nickname, domain, port,
item, avatarUrl, False, False,
httpPrefix, projectVersion, 'inbox',