mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-15 01:55:03 +00:00
Minor refactoring to actor_request().
Including commented out experimental code for collecting sharedInboxes.
This commit is contained in:
parent
d75a22adab
commit
eb0c7eabbb
1 changed files with 30 additions and 11 deletions
|
@ -96,12 +96,13 @@ int actor_request(snac *snac, char *actor, d_char **data)
|
|||
int status, status2;
|
||||
xs *payload = NULL;
|
||||
|
||||
if (data)
|
||||
*data = NULL;
|
||||
|
||||
/* get from disk first */
|
||||
status = actor_get(snac, actor, data);
|
||||
|
||||
if (status == 200)
|
||||
return status;
|
||||
|
||||
if (status != 200) {
|
||||
/* actor data non-existent or stale: get from the net */
|
||||
status2 = activitypub_request(snac, actor, &payload);
|
||||
|
||||
|
@ -114,6 +115,24 @@ int actor_request(snac *snac, char *actor, d_char **data)
|
|||
payload = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (valid_status(status) && data && *data) {
|
||||
xs *fn = xs_fmt("%s/inboxes.lst", srv_basedir);
|
||||
FILE *f;
|
||||
|
||||
if ((f = fopen(fn, "a")) != NULL) {
|
||||
char *v;
|
||||
if (!xs_is_null(v = xs_dict_get(*data, "endpoints")) &&
|
||||
!xs_is_null(v = xs_dict_get(v, "sharedInbox"))) {
|
||||
fprintf(f, "%s\n", v);
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue