Merge branch 'fix-delete-announce' into 'dev'
Fix forwarding Delete activity for Mastodon/Misskey See merge request pleroma/relay!41
This commit is contained in:
commit
f75c10a912
1 changed files with 17 additions and 1 deletions
|
@ -47,6 +47,22 @@ async def handle_forward(request, actor, data, software):
|
|||
request.app.cache.objects[data.id] = message.id
|
||||
|
||||
|
||||
async def handle_passthrough(request, actor, data, software):
|
||||
if data.id in request.app.cache.objects:
|
||||
logging.verbose(f'already passed {data.id}')
|
||||
return
|
||||
|
||||
message = data
|
||||
logging.verbose(f'Pass through post from {actor.id}')
|
||||
logging.debug(f'>> Relay {data}')
|
||||
|
||||
inboxes = misc.distill_inboxes(actor, data.id)
|
||||
futures = [misc.request(inbox, data=message) for inbox in inboxes]
|
||||
|
||||
asyncio.ensure_future(asyncio.gather(*futures))
|
||||
request.app.cache.objects[data.id] = message.id
|
||||
|
||||
|
||||
async def handle_follow(request, actor, data, software):
|
||||
if not request.app.database.add_inbox(actor.shared_inbox, data.id):
|
||||
request.app.database.set_followid(actor.id, data.id)
|
||||
|
@ -97,7 +113,7 @@ async def handle_undo(request, actor, data, software):
|
|||
processors = {
|
||||
'Announce': handle_relay,
|
||||
'Create': handle_relay,
|
||||
'Delete': handle_forward,
|
||||
'Delete': handle_passthrough,
|
||||
'Follow': handle_follow,
|
||||
'Undo': handle_undo,
|
||||
'Update': handle_forward,
|
||||
|
|
Loading…
Reference in a new issue