commit 4374081
grunfink
·
2025-09-03 18:48:31 +0000 UTC
parent 0c3665f
Revert "Also keep a 'personal' folder for better organization." This reverts commit 0c3665fc49064f1fd5a04f2427056f9ea37f8d70.
1 files changed,
+7,
-17
M
data.c
M
data.c
+7,
-17
1@@ -1383,13 +1383,8 @@ xs_str *timeline_fn_by_md5(snac *snac, const char *md5)
2 fn = xs_free(fn);
3 fn = xs_fmt("%s/public/%s.json", snac->basedir, md5);
4
5- if (mtime(fn) == 0.0) {
6+ if (mtime(fn) == 0.0)
7 fn = xs_free(fn);
8- fn = xs_fmt("%s/personal/%s.json", snac->basedir, md5);
9-
10- if (mtime(fn) == 0.0)
11- fn = xs_free(fn);
12- }
13 }
14 }
15
16@@ -1468,8 +1463,6 @@ void timeline_update_indexes(snac *snac, const char *id)
17 else
18 srv_debug(1, xs_fmt("Not added to public instance index %s", id));
19 }
20- else
21- object_user_cache_add(snac, id, "personal");
22 }
23 }
24 }
25@@ -3884,14 +3877,14 @@ void purge_server(void)
26 }
27
28
29-void delete_purged_posts(snac *user, const char *subdir, int days)
30+void delete_purged_posts(snac *user, int days)
31 /* enqueues Delete activities for local purged messages */
32 {
33 if (days == 0)
34 return;
35
36 time_t mt = time(NULL) - days * 24 * 3600;
37- xs *spec = xs_fmt("%s/%s/" "*.json", user->basedir, subdir);
38+ xs *spec = xs_fmt("%s/public/" "*.json", user->basedir);
39 xs *list = xs_glob(spec, 0, 0);
40 const char *v;
41
42@@ -3944,18 +3937,15 @@ void purge_user(snac *snac)
43 pub_days = user_days;
44 }
45
46- if (xs_is_true(xs_dict_get(srv_config, "propagate_local_purge"))) {
47- delete_purged_posts(snac, "public", pub_days);
48- delete_purged_posts(snac, "personal", pub_days);
49- }
50+ if (xs_is_true(xs_dict_get(srv_config, "propagate_local_purge")))
51+ delete_purged_posts(snac, pub_days);
52
53 _purge_user_subdir(snac, "hidden", priv_days);
54 _purge_user_subdir(snac, "private", priv_days);
55
56- _purge_user_subdir(snac, "public", pub_days);
57- _purge_user_subdir(snac, "personal", pub_days);
58+ _purge_user_subdir(snac, "public", pub_days);
59
60- const char *idxs[] = { "followers.idx", "private.idx", "public.idx", "personal.idx",
61+ const char *idxs[] = { "followers.idx", "private.idx", "public.idx",
62 "pinned.idx", "bookmark.idx", "draft.idx", "sched.idx", NULL };
63
64 for (n = 0; idxs[n]; n++) {