From 9deebab1a915338e056052bac79fc5537009779d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 29 Jul 2021 18:29:47 +0100 Subject: [PATCH] Detect users path --- inbox.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/inbox.py b/inbox.py index 72558db30..858d845c7 100644 --- a/inbox.py +++ b/inbox.py @@ -240,10 +240,14 @@ def getPersonPubKey(baseDir: str, session, personUrl: str, if not personUrl: return None personUrl = personUrl.replace('#main-key', '') - if personUrl.endswith('/users/inbox'): - if debug: - print('DEBUG: Obtaining public key for shared inbox') - personUrl = personUrl.replace('/users/inbox', '/inbox') + usersPaths = getUserPaths() + for possibleUsersPath in usersPaths: + if personUrl.endswith(possibleUsersPath + 'inbox'): + if debug: + print('DEBUG: Obtaining public key for shared inbox') + personUrl = \ + personUrl.replace(possibleUsersPath + 'inbox', '/inbox') + break personJson = \ getPersonFromCache(baseDir, personUrl, personCache, True) if not personJson: