summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/data.c b/data.c
index 1caaabe..7e90a06 100644
--- a/data.c
+++ b/data.c
@@ -1383,13 +1383,8 @@ xs_str *timeline_fn_by_md5(snac *snac, const char *md5)
1383 fn = xs_free(fn); 1383 fn = xs_free(fn);
1384 fn = xs_fmt("%s/public/%s.json", snac->basedir, md5); 1384 fn = xs_fmt("%s/public/%s.json", snac->basedir, md5);
1385 1385
1386 if (mtime(fn) == 0.0) { 1386 if (mtime(fn) == 0.0)
1387 fn = xs_free(fn); 1387 fn = xs_free(fn);
1388 fn = xs_fmt("%s/personal/%s.json", snac->basedir, md5);
1389
1390 if (mtime(fn) == 0.0)
1391 fn = xs_free(fn);
1392 }
1393 } 1388 }
1394 } 1389 }
1395 1390
@@ -1468,8 +1463,6 @@ void timeline_update_indexes(snac *snac, const char *id)
1468 else 1463 else
1469 srv_debug(1, xs_fmt("Not added to public instance index %s", id)); 1464 srv_debug(1, xs_fmt("Not added to public instance index %s", id));
1470 } 1465 }
1471 else
1472 object_user_cache_add(snac, id, "personal");
1473 } 1466 }
1474 } 1467 }
1475} 1468}
@@ -3884,14 +3877,14 @@ void purge_server(void)
3884} 3877}
3885 3878
3886 3879
3887void delete_purged_posts(snac *user, const char *subdir, int days) 3880void delete_purged_posts(snac *user, int days)
3888/* enqueues Delete activities for local purged messages */ 3881/* enqueues Delete activities for local purged messages */
3889{ 3882{
3890 if (days == 0) 3883 if (days == 0)
3891 return; 3884 return;
3892 3885
3893 time_t mt = time(NULL) - days * 24 * 3600; 3886 time_t mt = time(NULL) - days * 24 * 3600;
3894 xs *spec = xs_fmt("%s/%s/" "*.json", user->basedir, subdir); 3887 xs *spec = xs_fmt("%s/public/" "*.json", user->basedir);
3895 xs *list = xs_glob(spec, 0, 0); 3888 xs *list = xs_glob(spec, 0, 0);
3896 const char *v; 3889 const char *v;
3897 3890
@@ -3944,18 +3937,15 @@ void purge_user(snac *snac)
3944 pub_days = user_days; 3937 pub_days = user_days;
3945 } 3938 }
3946 3939
3947 if (xs_is_true(xs_dict_get(srv_config, "propagate_local_purge"))) { 3940 if (xs_is_true(xs_dict_get(srv_config, "propagate_local_purge")))
3948 delete_purged_posts(snac, "public", pub_days); 3941 delete_purged_posts(snac, pub_days);
3949 delete_purged_posts(snac, "personal", pub_days);
3950 }
3951 3942
3952 _purge_user_subdir(snac, "hidden", priv_days); 3943 _purge_user_subdir(snac, "hidden", priv_days);
3953 _purge_user_subdir(snac, "private", priv_days); 3944 _purge_user_subdir(snac, "private", priv_days);
3954 3945
3955 _purge_user_subdir(snac, "public", pub_days); 3946 _purge_user_subdir(snac, "public", pub_days);
3956 _purge_user_subdir(snac, "personal", pub_days);
3957 3947
3958 const char *idxs[] = { "followers.idx", "private.idx", "public.idx", "personal.idx", 3948 const char *idxs[] = { "followers.idx", "private.idx", "public.idx",
3959 "pinned.idx", "bookmark.idx", "draft.idx", "sched.idx", NULL }; 3949 "pinned.idx", "bookmark.idx", "draft.idx", "sched.idx", NULL };
3960 3950
3961 for (n = 0; idxs[n]; n++) { 3951 for (n = 0; idxs[n]; n++) {