From 8c7071b6e3731484a43d07f67d0b7da95bb4e1d5 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 18 Dec 2020 18:12:33 +0000 Subject: [PATCH] Single webfinger --- inbox.py | 10 +++++++++- webapp_profile.py | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/inbox.py b/inbox.py index 192a34f3..424d4766 100644 --- a/inbox.py +++ b/inbox.py @@ -173,9 +173,17 @@ def inboxStorePostToHtmlCache(recentPostsCache: {}, maxRecentPosts: int, avatarUrl = None 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)] + individualPostAsHtml(True, recentPostsCache, maxRecentPosts, translate, pageNumber, - baseDir, session, cachedWebfingers, personCache, + baseDir, session, wfRequest, personCache, nickname, domain, port, postJsonObject, avatarUrl, True, allowDeletion, httpPrefix, __version__, boxname, None, diff --git a/webapp_profile.py b/webapp_profile.py index f2f2a120..9df98ea6 100644 --- a/webapp_profile.py +++ b/webapp_profile.py @@ -259,10 +259,18 @@ def htmlProfileAfterSearch(cssCache: {}, continue 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)] + profileStr += \ individualPostAsHtml(True, recentPostsCache, maxRecentPosts, translate, None, baseDir, - session, cachedWebfingers, personCache, + session, wfRequest, personCache, nickname, domain, port, item, avatarUrl, False, False, httpPrefix, projectVersion, 'inbox',