Commit f34b42ae authored by kaniini's avatar kaniini

Merge branch 'feature-delete' into 'master'

Implement handle_delete to forward delete

Closes #2

See merge request !12
parents d890bdd6 08fe53bd
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment