forked from indymedia/epicyon
Store full actor if not following /users/ convention
parent
a2db59371b
commit
92256f20f8
11
follow.py
11
follow.py
|
@ -545,7 +545,7 @@ def receiveFollowRequest(session, baseDir: str, httpPrefix: str,
|
||||||
'/channel/' not in messageJson['actor'] and \
|
'/channel/' not in messageJson['actor'] and \
|
||||||
'/profile/' not in messageJson['actor']:
|
'/profile/' not in messageJson['actor']:
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: "users" or "profile" missing from actor')
|
print('DEBUG: users/profile/accounts/channel missing from actor')
|
||||||
return False
|
return False
|
||||||
domain, tempPort = getDomainFromActor(messageJson['actor'])
|
domain, tempPort = getDomainFromActor(messageJson['actor'])
|
||||||
fromPort = port
|
fromPort = port
|
||||||
|
@ -573,7 +573,8 @@ def receiveFollowRequest(session, baseDir: str, httpPrefix: str,
|
||||||
'/channel/' not in messageJson['object'] and \
|
'/channel/' not in messageJson['object'] and \
|
||||||
'/profile/' not in messageJson['object']:
|
'/profile/' not in messageJson['object']:
|
||||||
if debug:
|
if debug:
|
||||||
print('DEBUG: "users" or "profile" not found within object')
|
print('DEBUG: users/profile/channel/accounts ' +
|
||||||
|
'not found within object')
|
||||||
return False
|
return False
|
||||||
domainToFollow, tempPort = getDomainFromActor(messageJson['object'])
|
domainToFollow, tempPort = getDomainFromActor(messageJson['object'])
|
||||||
if not domainPermitted(domainToFollow, federationList):
|
if not domainPermitted(domainToFollow, federationList):
|
||||||
|
@ -662,6 +663,12 @@ def receiveFollowRequest(session, baseDir: str, httpPrefix: str,
|
||||||
followersFilename = \
|
followersFilename = \
|
||||||
baseDir + '/accounts/' + \
|
baseDir + '/accounts/' + \
|
||||||
nicknameToFollow + '@' + domainToFollow + '/followers.txt'
|
nicknameToFollow + '@' + domainToFollow + '/followers.txt'
|
||||||
|
|
||||||
|
# for actors which don't follow the mastodon
|
||||||
|
# /users/ path convention store the full actor
|
||||||
|
if '/users/' not in messageJson['actor']:
|
||||||
|
approveHandle = messageJson['actor']
|
||||||
|
|
||||||
print('Updating followers file: ' +
|
print('Updating followers file: ' +
|
||||||
followersFilename + ' adding ' + approveHandle)
|
followersFilename + ' adding ' + approveHandle)
|
||||||
if os.path.isfile(followersFilename):
|
if os.path.isfile(followersFilename):
|
||||||
|
|
Loading…
Reference in New Issue