Merge branch 'follows' into 'master'

remove unnecessary actor checking for (un)follows

See merge request pleroma/relay!22
This commit is contained in:
Haelwenn 2020-11-12 13:43:09 +00:00
commit a15d734218

View file

@ -242,8 +242,7 @@ async def handle_follow(actor, data, request):
following += [inbox] following += [inbox]
DATABASE['relay-list'] = following DATABASE['relay-list'] = following
if data['object'].endswith('/actor'): asyncio.ensure_future(follow_remote_actor(actor['id']))
asyncio.ensure_future(follow_remote_actor(actor['id']))
message = { message = {
"@context": "https://www.w3.org/ns/activitystreams", "@context": "https://www.w3.org/ns/activitystreams",
@ -253,10 +252,10 @@ async def handle_follow(actor, data, request):
# this is wrong per litepub, but mastodon < 2.4 is not compliant with that profile. # this is wrong per litepub, but mastodon < 2.4 is not compliant with that profile.
"object": { "object": {
"type": "Follow", "type": "Follow",
"id": data["id"], "id": data["id"],
"object": "https://{}/actor".format(request.host), "object": "https://{}/actor".format(request.host),
"actor": actor["id"] "actor": actor["id"]
}, },
"id": "https://{}/activities/{}".format(request.host, uuid.uuid4()), "id": "https://{}/activities/{}".format(request.host, uuid.uuid4()),
@ -278,8 +277,7 @@ async def handle_undo(actor, data, request):
following.remove(inbox) following.remove(inbox)
DATABASE['relay-list'] = following DATABASE['relay-list'] = following
if child['object'].endswith('/actor'): await unfollow_remote_actor(actor['id'])
await unfollow_remote_actor(actor['id'])
processors = { processors = {