mirror of https://gitlab.com/bashrc2/epicyon
Lookup of shared inbox
parent
646c3ecc1e
commit
ba3460418c
|
@ -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]
|
||||
|
|
19
person.py
19
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"}
|
||||
|
|
Loading…
Reference in New Issue