mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-12 21:10:22 +03:00
Don't store objects other than 'Note' in timeline_request().
This commit is contained in:
parent
5c81dd88bc
commit
34a2b47e85
@ -91,20 +91,24 @@ int timeline_request(snac *snac, char *id, char *referrer)
|
|||||||
status = activitypub_request(snac, id, &object);
|
status = activitypub_request(snac, id, &object);
|
||||||
|
|
||||||
if (valid_status(status)) {
|
if (valid_status(status)) {
|
||||||
char *actor = xs_dict_get(object, "attributedTo");
|
char *type = xs_dict_get(object, "type");
|
||||||
|
|
||||||
/* request (and drop) the actor for this entry */
|
if (!xs_is_null(type) && strcmp(type, "Note") == 0) {
|
||||||
if (!xs_is_null(actor))
|
char *actor = xs_dict_get(object, "attributedTo");
|
||||||
actor_request(snac, actor, NULL);
|
|
||||||
|
|
||||||
/* does it have an ancestor? */
|
/* request (and drop) the actor for this entry */
|
||||||
char *in_reply_to = xs_dict_get(object, "inReplyTo");
|
if (!xs_is_null(actor))
|
||||||
|
actor_request(snac, actor, NULL);
|
||||||
|
|
||||||
/* recurse! */
|
/* does it have an ancestor? */
|
||||||
timeline_request(snac, in_reply_to, referrer);
|
char *in_reply_to = xs_dict_get(object, "inReplyTo");
|
||||||
|
|
||||||
/* finally store */
|
/* recurse! */
|
||||||
timeline_add(snac, id, object, in_reply_to, referrer);
|
timeline_request(snac, in_reply_to, referrer);
|
||||||
|
|
||||||
|
/* finally store */
|
||||||
|
timeline_add(snac, id, object, in_reply_to, referrer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user