diff options
Diffstat (limited to 'data.c')
| -rw-r--r-- | data.c | 10 |
1 files changed, 10 insertions, 0 deletions
| @@ -631,6 +631,16 @@ int object_user_cache_del(snac *snac, const char *id, const char *cachedir) | |||
| 631 | } | 631 | } |
| 632 | 632 | ||
| 633 | 633 | ||
| 634 | int object_user_cache_in(snac *snac, const char *id, const char *cachedir) | ||
| 635 | /* checks if an object is stored in a cache */ | ||
| 636 | { | ||
| 637 | xs *md5 = xs_md5_hex(id, strlen(id)); | ||
| 638 | xs *cfn = xs_fmt("%s/%s/%s.json", snac->basedir, cachedir, md5); | ||
| 639 | |||
| 640 | return !!(mtime(cfn) != 0.0); | ||
| 641 | } | ||
| 642 | |||
| 643 | |||
| 634 | /** specialized functions **/ | 644 | /** specialized functions **/ |
| 635 | 645 | ||
| 636 | d_char *_follower_fn(snac *snac, char *actor) | 646 | d_char *_follower_fn(snac *snac, char *actor) |