Fixed bug in actor_request().

This commit is contained in:
default 2022-09-23 18:46:30 +02:00
parent a0bcc4e6c0
commit 6586be50a0
3 changed files with 15 additions and 2 deletions

View file

@ -65,8 +65,7 @@ int actor_request(snac *snac, char *actor, d_char **data)
if (valid_status(status2)) {
/* renew data */
xs *j = xs_json_dumps_pp(payload, 4);
status = actor_add(snac, actor, j);
status = actor_add(snac, actor, payload);
*data = payload;
payload = NULL;

13
main.c
View file

@ -91,6 +91,19 @@ int main(int argc, char *argv[])
xs *j = xs_json_dumps_pp(data, 4);
printf("%s\n", j);
}
return 0;
}
if (strcmp(cmd, "actor") == 0) {
int status;
xs *data = NULL;
status = actor_request(&snac, url, &data);
printf("status: %d\n", status);
return 0;
}
return 0;

1
snac.h
View file

@ -81,3 +81,4 @@ int webfinger_get_handler(d_char *req, char *q_path,
char **body, int *b_size, char **ctype);
int activitypub_request(snac *snac, char *url, d_char **data);
int actor_request(snac *snac, char *actor, d_char **data);