Read incoming deletion activities

This commit is contained in:
Mouse Reeve
2020-10-16 17:00:10 -07:00
parent 22410e3f47
commit 7f579ffefa
4 changed files with 36 additions and 1 deletions

View File

@ -57,6 +57,7 @@ def shared_inbox(request):
'Accept': handle_follow_accept,
'Reject': handle_follow_reject,
'Create': handle_create,
'Delete': handle_delete_status,
'Like': handle_favorite,
'Announce': handle_boost,
'Add': {
@ -229,6 +230,20 @@ def handle_create(activity):
)
@app.task
def handle_delete_status(activity):
''' remove a status '''
status_id = activity['object']['id']
try:
status = models.Status.objects.select_subclasses().get(
remote_id=status_id
)
except models.Status.DoesNotExist:
return
status_builder.delete_status(status)
@app.task
def handle_favorite(activity):
''' approval of your good good post '''