From ba3460418c4c7f16ef8368b7f1a8f60ef99edc6b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 5 Aug 2019 16:22:59 +0100 Subject: [PATCH] Lookup of shared inbox --- daemon.py | 3 +-- person.py | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/daemon.py b/daemon.py index d7333dd53..7e49e628a 100644 --- a/daemon.py +++ b/daemon.py @@ -438,8 +438,7 @@ class PubServer(BaseHTTPRequestHandler): if 'text/html' in self.headers['Accept'] and self.path!='/login': if '/media/' not in self.path and \ '/sharefiles/' not in self.path and \ - '/icons/' not in self.path and \ - self.path != '/inbox': + '/icons/' not in self.path: divertToLoginScreen=True if self.path.startswith('/users/'): nickStr=self.path.split('/users/')[1] diff --git a/person.py b/person.py index a8b0f85b7..1cb729ede 100644 --- a/person.py +++ b/person.py @@ -267,12 +267,15 @@ def personLookup(domain: str,path: str,baseDir: str) -> {}: """ if path.endswith('#main-key'): path=path.replace('#main-key','') - notPersonLookup=['/inbox','/outbox','/outboxarchive', \ - '/followers','/following','/featured', \ - '.png','.jpg','.gif','.mpv'] - for ending in notPersonLookup: - if path.endswith(ending): - return None + if path=='/inbox' or path=='/users/inbox' or path=='/sharedInbox': + path='/users/inbox' + else: + notPersonLookup=['/inbox','/outbox','/outboxarchive', \ + '/followers','/following','/featured', \ + '.png','.jpg','.gif','.mpv'] + for ending in notPersonLookup: + if path.endswith(ending): + return None nickname=None if path.startswith('/users/'): nickname=path.replace('/users/','',1) @@ -284,8 +287,8 @@ def personLookup(domain: str,path: str,baseDir: str) -> {}: return None if ':' in domain: domain=domain.split(':')[0] - handle=nickname.lower()+'@'+domain.lower() - filename=baseDir+'/accounts/'+handle.lower()+'.json' + handle=nickname+'@'+domain + filename=baseDir+'/accounts/'+handle+'.json' if not os.path.isfile(filename): return None personJson={"user": "unknown"}