Check for single webfinger

merge-requests/30/head
Bob Mottram 2021-01-10 09:51:30 +00:00
parent 56ba0f28d7
commit e7252a643f
2 changed files with 9 additions and 4 deletions

View File

@ -218,10 +218,6 @@ def getPersonBox(baseDir: str, session, wfRequest: {},
'Accept': 'application/activity+json; profile="' + profileStr + '"'
}
if not wfRequest.get('errors'):
# if len(wfRequest.items()) == 1:
# for wfkey, wf in wfRequest.items():
# wfRequest = wf
# print('wfRequest changed to ' + str(wfRequest))
personUrl = getUserUrl(wfRequest, sourceId)
else:
if nickname == 'dev':

View File

@ -1163,6 +1163,15 @@ def individualPostAsHtml(allowDownloads: bool,
postActorWf = cachedWebfingers[postActorHandle]
print('postActorWf: ' + postActorHandle + ' ' + str(postActorWf))
# check for situations where the webfinger contains a single key
# which is the handle, with the webfinger content as the item
if len(postActorWf.items()) == 1:
for wfkey, wf in postActorWf.items():
print('Single webfinger key: ' + wfkey + ' ' + postActorHandle)
if wfkey == postActorHandle:
postActorWf = wf
print('wfRequest changed to ' + str(postActorWf))
(inboxUrl, pubKeyId, pubKey,
fromPersonId, sharedInbox,
avatarUrl2, displayName) = getPersonBox(baseDir, session,