From a6712ba79a617e4481117fe486858d62977f0260 Mon Sep 17 00:00:00 2001 From: default Date: Sat, 24 Sep 2022 10:03:27 +0200 Subject: Also store the req object in enqueue_input(). --- activitypub.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'activitypub.c') diff --git a/activitypub.c b/activitypub.c index 8ee7b3d..7701ecf 100644 --- a/activitypub.c +++ b/activitypub.c @@ -122,6 +122,9 @@ void process_message(snac *snac, char *msg) char *actor = xs_dict_get(msg, "actor"); char *type = xs_dict_get(msg, "type"); + /* check the signature */ + /* ... */ + if (strcmp(type, "Follow") == 0) { } else @@ -179,7 +182,7 @@ void process_queue(snac *snac) snac_log(snac, xs_fmt("process_queue giving up %s %d", actor, status)); else { /* reenqueue */ - enqueue_output(snac, actor, msg, retries + 1); + enqueue_output(snac, msg, actor, retries + 1); snac_log(snac, xs_fmt("process_queue requeue %s %d", actor, retries + 1)); } } @@ -292,14 +295,11 @@ int activitypub_post_handler(d_char *req, char *q_path, return 404; } - /* signature checking should happen here */ - /* ... */ - /* decode */ xs *msg = xs_json_loads(payload); if (msg && xs_dict_get(msg, "actor") && xs_dict_get(msg, "type")) - enqueue_input(&snac, msg); + enqueue_input(&snac, msg, req); else { srv_log(xs_fmt("activitypub_post_handler JSON error %s", q_path)); status = 400; -- cgit v1.2.3