summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
authorGravatar default2023-11-08 09:20:34 +0100
committerGravatar default2023-11-08 09:20:34 +0100
commit55d3ef5024d4a597ddeae23ca7d29375c7d6a9d3 (patch)
treea32a47d8085154fede0ca19a27a8e5043cf1cdf3 /httpd.c
parentNew code for indexing tags. (diff)
downloadpenes-snac2-55d3ef5024d4a597ddeae23ca7d29375c7d6a9d3.tar.gz
penes-snac2-55d3ef5024d4a597ddeae23ca7d29375c7d6a9d3.tar.xz
penes-snac2-55d3ef5024d4a597ddeae23ca7d29375c7d6a9d3.zip
Tags can now be searched for from the server base URL.
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/httpd.c b/httpd.c
index aed15dc..2a91523 100644
--- a/httpd.c
+++ b/httpd.c
@@ -141,6 +141,21 @@ int server_get_handler(xs_dict *req, const char *q_path,
141 141
142 /* is it the server root? */ 142 /* is it the server root? */
143 if (*q_path == '\0') { 143 if (*q_path == '\0') {
144 xs_dict *q_vars = xs_dict_get(req, "q_vars");
145 char *t = NULL;
146
147 if (xs_type(q_vars) == XSTYPE_DICT && (t = xs_dict_get(q_vars, "t"))) {
148 /* tag search query */
149 int skip = xs_number_get(xs_dict_get(q_vars, "skip"));
150 int show = xs_number_get(xs_dict_get(q_vars, "show"));
151
152 if (show == 0)
153 show = 64;
154
155 xs *tl = tag_search(t, skip, show);
156 *body = html_timeline(NULL, tl, 0, skip, show, 0);
157 }
158 else
144 if (xs_type(xs_dict_get(srv_config, "show_instance_timeline")) == XSTYPE_TRUE) { 159 if (xs_type(xs_dict_get(srv_config, "show_instance_timeline")) == XSTYPE_TRUE) {
145 xs *tl = timeline_instance_list(0, 30); 160 xs *tl = timeline_instance_list(0, 30);
146 *body = html_timeline(NULL, tl, 0, 0, 0, 0); 161 *body = html_timeline(NULL, tl, 0, 0, 0, 0);