diff --git a/inbox.py b/inbox.py index 7f5a4aa3d..54e042cac 100644 --- a/inbox.py +++ b/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, diff --git a/posts.py b/posts.py index cd205b49b..c98669627 100644 --- a/posts.py +++ b/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')): diff --git a/webapp_profile.py b/webapp_profile.py index e1e05727f..c6480e1e4 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -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,