Lookup of shared inbox

master
Bob Mottram 2019-08-05 16:22:59 +01:00
parent 646c3ecc1e
commit ba3460418c
2 changed files with 12 additions and 10 deletions

View File

@ -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]

View File

@ -267,6 +267,9 @@ def personLookup(domain: str,path: str,baseDir: str) -> {}:
"""
if path.endswith('#main-key'):
path=path.replace('#main-key','')
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']
@ -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"}