commit 9c136dacdf790fdfe30d1c48ad9b03add206bf73
parent 09d33b8e08a0b877761f5b1a901e2b4e765e0067
Author: default <nobody@localhost>
Date: Mon, 28 Nov 2022 08:34:19 +0100
New function object_user_cache_in().
Diffstat:
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/data.c b/data.c
@@ -631,6 +631,16 @@ int object_user_cache_del(snac *snac, const char *id, const char *cachedir)
}
+int object_user_cache_in(snac *snac, const char *id, const char *cachedir)
+/* checks if an object is stored in a cache */
+{
+ xs *md5 = xs_md5_hex(id, strlen(id));
+ xs *cfn = xs_fmt("%s/%s/%s.json", snac->basedir, cachedir, md5);
+
+ return !!(mtime(cfn) != 0.0);
+}
+
+
/** specialized functions **/
d_char *_follower_fn(snac *snac, char *actor)