summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
Diffstat (limited to 'data.c')
-rw-r--r--data.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/data.c b/data.c
index 0d85efd..fd5d02c 100644
--- a/data.c
+++ b/data.c
@@ -1575,11 +1575,24 @@ void purge_server(void)
void purge_user(snac *snac)
/* do the purge for this user */
{
- int priv_days, pub_days;
+ int priv_days, pub_days, user_days = 0;
+ char *v;
priv_days = xs_number_get(xs_dict_get(srv_config, "timeline_purge_days"));
pub_days = xs_number_get(xs_dict_get(srv_config, "local_purge_days"));
+ if ((v = xs_dict_get(snac->config, "purge_days")) != NULL)
+ user_days = xs_number_get(v);
+
+ if (user_days) {
+ /* override admin settings only if they are lesser */
+ if (priv_days == 0 || user_days < priv_days)
+ priv_days = user_days;
+
+ if (pub_days == 0 || user_days < pub_days)
+ pub_days = user_days;
+ }
+
_purge_subdir(snac, "hidden", priv_days);
_purge_subdir(snac, "private", priv_days);