diff options
author | default <nobody@localhost> | 2023-09-18 22:52:27 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-09-18 22:52:27 +0200 |
commit | f8c62fe2102c28e9a59bf4cf14ad6b893753a8d3 (patch) | |
tree | a1e664f31e7309a7b065a4f78abee9d7e62c4bd9 /data.c | |
parent | 5afa5ab071fc253cd11f8549de4ae8a5584451ad (diff) |
Pinned posts are never purged.
Diffstat (limited to 'data.c')
-rw-r--r-- | data.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1343,6 +1343,13 @@ int is_pinned(snac *user, const char *id) } +int is_pinned_by_md5(snac *user, const char *md5) +{ + xs *fn = xs_fmt("%s/pinned/%s.json", user->basedir, md5); + return !!(mtime(fn) != 0.0); +} + + int pin(snac *user, const char *id) /* pins a message */ { @@ -2436,7 +2443,6 @@ void purge_user(snac *snac) _purge_user_subdir(snac, "hidden", priv_days); _purge_user_subdir(snac, "private", priv_days); - _purge_user_subdir(snac, "pinned", pub_days); _purge_user_subdir(snac, "public", pub_days); const char *idxs[] = { "followers.idx", "private.idx", "public.idx", "pinned.idx", NULL }; |