mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-03 00:31:25 -08:00
a way for senders to see the result of their POST to our inbox
for debugging
This commit is contained in:
parent
35efd7725c
commit
6ce5e7208c
1 changed files with 14 additions and 0 deletions
|
@ -1255,3 +1255,17 @@ def activities_json(type, id):
|
||||||
return resp
|
return resp
|
||||||
else:
|
else:
|
||||||
abort(404)
|
abort(404)
|
||||||
|
|
||||||
|
|
||||||
|
# Other instances can query the result of their POST to the inbox by using this endpoint. The ID of the activity they
|
||||||
|
# sent (minus the https:// on the front) is the id parameter. e.g. https://piefed.ngrok.app/activity_result/piefed.ngrok.app/activities/announce/EfjyZ3BE5SzQK0C
|
||||||
|
@bp.route('/activity_result/<path:id>')
|
||||||
|
def activity_result(id):
|
||||||
|
activity = ActivityPubLog.query.filter_by(activity_id=f'https://{id}').first()
|
||||||
|
if activity:
|
||||||
|
if activity.result == 'success':
|
||||||
|
return jsonify('Ok')
|
||||||
|
else:
|
||||||
|
return jsonify({'error': activity.result, 'message': activity.exception_message})
|
||||||
|
else:
|
||||||
|
abort(404)
|
||||||
|
|
Loading…
Add table
Reference in a new issue