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': if boxname != 'tlevents' and boxname != 'outbox':
boxname = 'inbox' 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, individualPostAsHtml(True, recentPostsCache, maxRecentPosts,
translate, pageNumber, translate, pageNumber,
baseDir, session, wfRequest, personCache, baseDir, session, cachedWebfingers,
personCache,
nickname, domain, port, postJsonObject, nickname, domain, port, postJsonObject,
avatarUrl, True, allowDeletion, avatarUrl, True, allowDeletion,
httpPrefix, __version__, boxname, None, httpPrefix, __version__, boxname, None,

View File

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

View File

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