summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-06-15 04:19:09 +0200
committerdefault <nobody@localhost>2023-06-15 04:19:09 +0200
commit297b82c9c627aabd9f17700d2b7958ba728543fb (patch)
tree7fb73ff4819e08d2c3fbeadc0e5c6b6b2a4c3c55
parente97092cf0c35fb51c2900c8001d89daf32a07ba1 (diff)
following_list() creates links to the actors if they don't exist.
-rw-r--r--data.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/data.c b/data.c
index 0a7898b..922b803 100644
--- a/data.c
+++ b/data.c
@@ -1256,13 +1256,23 @@ xs_list *following_list(snac *snac)
xs *o = xs_json_loads(j);
if (o != NULL) {
- char *type = xs_dict_get(o, "type");
+ const char *type = xs_dict_get(o, "type");
if (!xs_is_null(type) && strcmp(type, "Accept") == 0) {
- char *actor = xs_dict_get(o, "actor");
+ const char *actor = xs_dict_get(o, "actor");
- if (!xs_is_null(actor))
+ if (!xs_is_null(actor)) {
list = xs_list_append(list, actor);
+
+ /* check if there is a link to the actor object */
+ xs *v2 = xs_replace(v, ".json", "");
+
+ if (mtime(v2) == 0.0) {
+ /* no; add a link to it */
+ xs *actor_fn = _object_fn(actor);
+ link(actor_fn, v2);
+ }
+ }
}
}
}