diff options
| author | 2023-06-15 04:56:44 +0200 | |
|---|---|---|
| committer | 2023-06-15 04:56:44 +0200 | |
| commit | 2076267c039bf7cc221e02a533db1013357435dd (patch) | |
| tree | d8f729129cc758b99ca2b65ea7232dea274d9c1c | |
| parent | Updated TODO. (diff) | |
| download | snac2-2076267c039bf7cc221e02a533db1013357435dd.tar.gz snac2-2076267c039bf7cc221e02a533db1013357435dd.tar.xz snac2-2076267c039bf7cc221e02a533db1013357435dd.zip | |
Avoid returning 'ghost' no-longer-followers in followers_list().
| -rw-r--r-- | data.c | 11 |
1 files changed, 8 insertions, 3 deletions
| @@ -933,10 +933,15 @@ xs_list *follower_list(snac *snac) | |||
| 933 | xs *a_obj = NULL; | 933 | xs *a_obj = NULL; |
| 934 | 934 | ||
| 935 | if (valid_status(object_get_by_md5(v, &a_obj))) { | 935 | if (valid_status(object_get_by_md5(v, &a_obj))) { |
| 936 | char *actor = xs_dict_get(a_obj, "id"); | 936 | const char *actor = xs_dict_get(a_obj, "id"); |
| 937 | 937 | ||
| 938 | if (!xs_is_null(actor)) | 938 | if (!xs_is_null(actor)) { |
| 939 | fwers = xs_list_append(fwers, actor); | 939 | /* check if the actor is still cached */ |
| 940 | xs *fn = xs_fmt("%s/followers/%s.json", snac->basedir, v); | ||
| 941 | |||
| 942 | if (mtime(fn) > 0.0) | ||
| 943 | fwers = xs_list_append(fwers, actor); | ||
| 944 | } | ||
| 940 | } | 945 | } |
| 941 | } | 946 | } |
| 942 | 947 | ||