summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
authorGravatar default2023-12-29 10:58:21 +0100
committerGravatar default2023-12-29 10:58:21 +0100
commitb31abde6bd65e666da3de4dc0a4aea3da42211cc (patch)
treef94fa10286f2bae0004211b6a62cf81d49db354e /httpd.c
parentIn 'Follow', ensure the actor object to be followed is here. (diff)
downloadsnac2-b31abde6bd65e666da3de4dc0a4aea3da42211cc.tar.gz
snac2-b31abde6bd65e666da3de4dc0a4aea3da42211cc.tar.xz
snac2-b31abde6bd65e666da3de4dc0a4aea3da42211cc.zip
Minor tweaks to /.well-known/nodeinfo returned data.
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/httpd.c b/httpd.c
index f4cc46c..25740df 100644
--- a/httpd.c
+++ b/httpd.c
@@ -62,14 +62,14 @@ xs_str *nodeinfo_2_0(void)
62 int n_uhyear = 0; 62 int n_uhyear = 0;
63 int n_posts = 0; 63 int n_posts = 0;
64 xs *users = user_list(); 64 xs *users = user_list();
65 xs_list *p; 65 xs_list *p = users;
66 char *v; 66 char *v;
67 double now = (double)time(NULL);
67 68
68 p = users;
69 while (xs_list_iter(&p, &v)) { 69 while (xs_list_iter(&p, &v)) {
70 /* build the full path name to the last usage log */ 70 /* build the full path name to the last usage log */
71 xs *llfn = xs_fmt("%s/user/%s/lastlog.txt", srv_basedir, v); 71 xs *llfn = xs_fmt("%s/user/%s/lastlog.txt", srv_basedir, v);
72 double llsecs = (double)time(NULL) - mtime(llfn); 72 double llsecs = now - mtime(llfn);
73 73
74 if (llsecs < 60 * 60 * 24 * 30 * 6) { 74 if (llsecs < 60 * 60 * 24 * 30 * 6) {
75 n_uhyear++; 75 n_uhyear++;
@@ -81,7 +81,7 @@ xs_str *nodeinfo_2_0(void)
81 n_utotal++; 81 n_utotal++;
82 82
83 /* build the file to each user public.idx */ 83 /* build the file to each user public.idx */
84 xs *pidxfn = xs_fmt("%s/user/%s/private.idx", srv_basedir, v); 84 xs *pidxfn = xs_fmt("%s/user/%s/public.idx", srv_basedir, v);
85 n_posts += index_len(pidxfn); 85 n_posts += index_len(pidxfn);
86 } 86 }
87 87