summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-06-15 04:56:44 +0200
committerdefault <nobody@localhost>2023-06-15 04:56:44 +0200
commit2076267c039bf7cc221e02a533db1013357435dd (patch)
treed8f729129cc758b99ca2b65ea7232dea274d9c1c
parentdccb6cdd81c30ef6b5538d16aad28215e7000551 (diff)
Avoid returning 'ghost' no-longer-followers in followers_list().
-rw-r--r--data.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/data.c b/data.c
index b197936..52e0f09 100644
--- a/data.c
+++ b/data.c
@@ -933,10 +933,15 @@ xs_list *follower_list(snac *snac)
xs *a_obj = NULL;
if (valid_status(object_get_by_md5(v, &a_obj))) {
- char *actor = xs_dict_get(a_obj, "id");
+ const char *actor = xs_dict_get(a_obj, "id");
- if (!xs_is_null(actor))
- fwers = xs_list_append(fwers, actor);
+ if (!xs_is_null(actor)) {
+ /* check if the actor is still cached */
+ xs *fn = xs_fmt("%s/followers/%s.json", snac->basedir, v);
+
+ if (mtime(fn) > 0.0)
+ fwers = xs_list_append(fwers, actor);
+ }
}
}