diff options
author | default <nobody@localhost> | 2022-09-24 10:03:27 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2022-09-24 10:03:27 +0200 |
commit | a6712ba79a617e4481117fe486858d62977f0260 (patch) | |
tree | d975efbf9ddacd7a7aa6cf77514b0048a74ab764 /activitypub.c | |
parent | 3df33c845d2a504017065505d91a5ad1c0593408 (diff) |
Also store the req object in enqueue_input().
Diffstat (limited to 'activitypub.c')
-rw-r--r-- | activitypub.c | 10 |
1 files changed, 5 insertions, 5 deletions
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; |