Merge branch 'feature-delete' into 'master'

Implement handle_delete to forward delete

Closes #2

See merge request pleroma/relay!12
This commit is contained in:
kaniini 2019-05-13 18:41:06 +00:00
commit f34b42ae78

View file

@ -209,6 +209,22 @@ async def handle_relay(actor, data, request):
CACHE[object_id] = activity_id
async def handle_delete(actor, data, request):
object_id = distill_object_id(data)
logging.debug('>> Relay %r', data)
inboxes = distill_inboxes(actor, object_id)
futures = [
push_message_to_actor(
{'inbox': inbox},
data,
'https://{}/actor#main-key'.format(request.host))
for inbox in inboxes]
asyncio.ensure_future(asyncio.gather(*futures))
async def handle_follow(actor, data, request):
global DATABASE
@ -265,6 +281,7 @@ async def handle_undo(actor, data, request):
processors = {
'Announce': handle_relay,
'Create': handle_relay,
'Delete': handle_delete,
'Follow': handle_follow,
'Undo': handle_undo
}