diff --git a/daemon.py b/daemon.py index eea17a09..52979332 100644 --- a/daemon.py +++ b/daemon.py @@ -3803,8 +3803,6 @@ class PubServer(BaseHTTPRequestHandler): lastPartOfUrl = actorUrl.split('/')[-1] srchStr = '/' + lastPartOfUrl actorUrl = actorUrl.replace(srchStr, repStr) - actorUrl = actorUrl.replace('/users/', - '/accounts/avatars/') actorJson['icon']['url'] = actorUrl print('actorUrl: ' + actorUrl) if '.' in actorUrl: @@ -9360,16 +9358,6 @@ 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 = \ diff --git a/person.py b/person.py index f470b444..406700b2 100644 --- a/person.py +++ b/person.py @@ -148,15 +148,13 @@ def randomizeActorImages(personJson: {}) -> None: This causes other instances to update their cached avatar image """ personId = personJson['id'] - nickname = personId.split('/users/')[1] lastPartOfFilename = personJson['icon']['url'].split('/')[-1] existingExtension = lastPartOfFilename.split('.')[1] # NOTE: these files don't need to have cryptographically # secure names randStr = str(randint(10000000000000, 99999999999999)) # nosec personJson['icon']['url'] = \ - '/accounts/avatars/' + nickname + \ - '/avatar' + randStr + '.' + existingExtension + personId + '/avatar' + randStr + '.' + existingExtension lastPartOfFilename = personJson['image']['url'].split('/')[-1] existingExtension = lastPartOfFilename.split('.')[1] randStr = str(randint(10000000000000, 99999999999999)) # nosec