diff --git a/fedireads/incoming.py b/fedireads/incoming.py index 355ab269..0513c2ea 100644 --- a/fedireads/incoming.py +++ b/fedireads/incoming.py @@ -100,8 +100,7 @@ def shared_inbox(request): return handle_incoming_create(activity) if activity['type'] == 'Accept': - # aww yay, friendship - return HttpResponse() + return handle_incoming_follow_accept(activity) return HttpResponseNotFound() @@ -267,6 +266,17 @@ def handle_incoming_follow(activity): }) +def handle_incoming_follow_accept(activity): + ''' hurray, someone remote accepted a follow request ''' + # figure out who they want to follow + requester = models.User.objects.get(actor=activity['object']['actor']) + # figure out who they are + accepter = get_or_create_remote_user(activity['actor']) + + accepter.followers.add(requester) + return HttpResponse() + + def handle_incoming_create(activity): ''' someone did something, good on them ''' user = get_or_create_remote_user(activity['actor']) diff --git a/fedireads/templates/user.html b/fedireads/templates/user.html index 416ca201..f81f60f7 100644 --- a/fedireads/templates/user.html +++ b/fedireads/templates/user.html @@ -10,7 +10,7 @@ {{ user.username }} {% if user.summary %} -
{{ user.summary }}
+
{{ user.summary | safe }}
{% endif %} {% if not is_self %} {% if not request.user in user.followers.all %}