diff options
| author | 2023-06-15 04:29:26 +0200 | |
|---|---|---|
| committer | 2023-06-15 04:29:26 +0200 | |
| commit | 2bed69d00b76a8b54f027e9edd6df6c968cdf1b9 (patch) | |
| tree | 96e393d5f22b7e2949b1477d3c6d5d0f9413c7cc | |
| parent | following_list() creates links to the actors if they don't exist. (diff) | |
| download | snac2-2bed69d00b76a8b54f027e9edd6df6c968cdf1b9.tar.gz snac2-2bed69d00b76a8b54f027e9edd6df6c968cdf1b9.tar.xz snac2-2bed69d00b76a8b54f027e9edd6df6c968cdf1b9.zip | |
Use the _a.json extension for actor object links into following/.
| -rw-r--r-- | data.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -1174,7 +1174,7 @@ int following_add(snac *snac, const char *actor, const xs_dict *msg) | |||
| 1174 | xs *actor_fn = _object_fn(actor); | 1174 | xs *actor_fn = _object_fn(actor); |
| 1175 | 1175 | ||
| 1176 | /* increase its reference count */ | 1176 | /* increase its reference count */ |
| 1177 | fn = xs_replace_i(fn, ".json", ""); | 1177 | fn = xs_replace_i(fn, ".json", "_a.json"); |
| 1178 | link(actor_fn, fn); | 1178 | link(actor_fn, fn); |
| 1179 | } | 1179 | } |
| 1180 | else | 1180 | else |
| @@ -1196,7 +1196,7 @@ int following_del(snac *snac, const char *actor) | |||
| 1196 | unlink(fn); | 1196 | unlink(fn); |
| 1197 | 1197 | ||
| 1198 | /* also delete the reference to the author */ | 1198 | /* also delete the reference to the author */ |
| 1199 | fn = xs_replace_i(fn, ".json", ""); | 1199 | fn = xs_replace_i(fn, ".json", "_a.json"); |
| 1200 | unlink(fn); | 1200 | unlink(fn); |
| 1201 | 1201 | ||
| 1202 | return 200; | 1202 | return 200; |
| @@ -1265,7 +1265,7 @@ xs_list *following_list(snac *snac) | |||
| 1265 | list = xs_list_append(list, actor); | 1265 | list = xs_list_append(list, actor); |
| 1266 | 1266 | ||
| 1267 | /* check if there is a link to the actor object */ | 1267 | /* check if there is a link to the actor object */ |
| 1268 | xs *v2 = xs_replace(v, ".json", ""); | 1268 | xs *v2 = xs_replace(v, ".json", "_a.json"); |
| 1269 | 1269 | ||
| 1270 | if (mtime(v2) == 0.0) { | 1270 | if (mtime(v2) == 0.0) { |
| 1271 | /* no; add a link to it */ | 1271 | /* no; add a link to it */ |