summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-09-18 22:52:27 +0200
committerdefault <nobody@localhost>2023-09-18 22:52:27 +0200
commitf8c62fe2102c28e9a59bf4cf14ad6b893753a8d3 (patch)
treea1e664f31e7309a7b065a4f78abee9d7e62c4bd9 /data.c
parent5afa5ab071fc253cd11f8549de4ae8a5584451ad (diff)
Pinned posts are never purged.
Diffstat (limited to 'data.c')
-rw-r--r--data.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/data.c b/data.c
index 2e9f3b7..3b22114 100644
--- a/data.c
+++ b/data.c
@@ -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 };