1
0
Fork 0

Send a different review to mastodon than to fedireads

This commit is contained in:
Mouse Reeve 2020-02-18 17:30:23 -08:00
parent 0447fef279
commit 14d300162d
9 changed files with 44 additions and 11 deletions

View file

@ -205,11 +205,13 @@ def handle_incoming_create(activity):
if not 'object' in activity:
return HttpResponseBadRequest()
# TODO: should only create notes if they are relevent to a book,
# so, not every single thing someone posts on mastodon
response = HttpResponse()
content = activity['object'].get('content')
if activity['object'].get('fedireadsType') == 'Review' and \
'inReplyTo' in activity['object']:
book = activity['object']['inReplyTo']
'inReplyToBook' in activity['object']:
book = activity['object']['inReplyToBook']
book = book.split('/')[-1]
name = activity['object'].get('name')
rating = activity['object'].get('rating')