mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-09 11:40:27 +03:00
New function object_user_cache_in().
This commit is contained in:
parent
09d33b8e08
commit
9c136dacdf
10
data.c
10
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)
|
||||
|
Loading…
Reference in New Issue
Block a user