Adds commenting
This commit is contained in:
@ -14,6 +14,7 @@ from fedireads import models
|
||||
from fedireads import outgoing
|
||||
from fedireads.status import create_review, create_status
|
||||
from fedireads.remote_user import get_or_create_remote_user
|
||||
from fedireads.settings import DOMAIN
|
||||
|
||||
|
||||
@csrf_exempt
|
||||
@ -133,6 +134,34 @@ def get_status(request, username, status_id):
|
||||
return JsonResponse(activitypub.get_status(status))
|
||||
|
||||
|
||||
@csrf_exempt
|
||||
def get_replies(request, username, status_id):
|
||||
''' ordered collection of replies to a status '''
|
||||
if request.method != 'GET':
|
||||
return HttpResponseBadRequest()
|
||||
|
||||
replies = models.Status.objects.filter(
|
||||
reply_parent=status_id
|
||||
).first()
|
||||
|
||||
path_id = 'https://%s/user/%s/status/%s/replies' % \
|
||||
(DOMAIN, username, status_id)
|
||||
replies_activity = {
|
||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
'id': path_id,
|
||||
'type': 'Collection',
|
||||
'first': {
|
||||
'id': '%s?page=true' % path_id,
|
||||
'type': 'CollectionPage',
|
||||
'next': '%s?only_other_accounts=true&page=true' % path_id,
|
||||
'partOf': path_id,
|
||||
'items': [replies.activity]
|
||||
}
|
||||
}
|
||||
return JsonResponse(replies_activity)
|
||||
|
||||
|
||||
|
||||
@csrf_exempt
|
||||
def get_followers(request, username):
|
||||
''' return a list of followers for an actor '''
|
||||
|
Reference in New Issue
Block a user