change follow accept/followback logic to involve our own actor

This commit is contained in:
jesopo 2019-09-15 12:17:24 +01:00
parent 4b42549b55
commit 980a407ebb

View file

@ -188,13 +188,15 @@ class Server(object):
key_id = self._ap_keyid_url(event["url_for"]) key_id = self._ap_keyid_url(event["url_for"])
private_key = self._private_key(key_id) private_key = self._private_key(key_id)
our_actor = ap_actor.Actor(self_id)
actor = ap_actor.Actor(new_follower) actor = ap_actor.Actor(new_follower)
actor.load() actor.load()
accept = ap_activities.Accept(data["id"], data) accept = ap_activities.Accept(data["id"], data)
actor.inbox.send(accept, private_key) actor.inbox.send(our_actor, accept, private_key
follow_id = "data:%s" % str(uuid.uuid4()) follow_id = "data:%s" % str(uuid.uuid4())
follow = ap_activities.Follow(follow_id, self_id) follow = ap_activities.Follow(follow_id, actor.url)
actor.inbox.send(follow, private_key) actor.inbox.send(our_actor, follow, private_key)
else: else:
event["response"].code = 404 event["response"].code = 404