mirror of https://gitlab.com/bashrc2/epicyon
Alternative path for avatar images
parent
8150fc9c11
commit
5acc6fe3b2
16
daemon.py
16
daemon.py
|
@ -3802,9 +3802,11 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
lastPartOfUrl = \
|
||||
actorJson['icon']['url'].split('/')[-1]
|
||||
srchStr = '/' + lastPartOfUrl
|
||||
actorUrl = actorJson['icon']['url']
|
||||
actorUrl = actorUrl.replace(srchStr, repStr)
|
||||
actorJson['icon']['url'] = \
|
||||
actorJson['icon']['url'].replace(srchStr,
|
||||
repStr)
|
||||
actorUrl.replace('/users/',
|
||||
'/accounts/avatars/')
|
||||
if '.' in actorJson['icon']['url']:
|
||||
imgExt = \
|
||||
actorJson['icon']['url'].split('.')[-1]
|
||||
|
@ -9359,6 +9361,16 @@ class PubServer(BaseHTTPRequestHandler):
|
|||
'_nodeinfo(callingDomain)',
|
||||
'_mastoApi(callingDomain)')
|
||||
|
||||
# alternative way of referencing avatar images
|
||||
# /accounts/avatars/nickname/avatar[number].png
|
||||
# instead of /users/nickname/avatar[number].png
|
||||
if self.path.startswith('/accounts/avatars/'):
|
||||
nickname = self.path.split('/accounts/avatars/')[1]
|
||||
if '/' in nickname:
|
||||
avatarFilename = nickname.split('/')[1]
|
||||
nickname = nickname.split('/')[0]
|
||||
self.path = '/users/' + nickname + '/' + avatarFilename
|
||||
|
||||
if self.path == '/logout':
|
||||
if not self.server.newsInstance:
|
||||
msg = \
|
||||
|
|
Loading…
Reference in New Issue