diff options
Diffstat (limited to '')
-rw-r--r-- | contexts.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/contexts.c b/contexts.c index 04b44ac..b486ef9 100644 --- a/contexts.c +++ b/contexts.c @@ -15,12 +15,16 @@ */ #include <err.h> +#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <sysexits.h> #include "server.h" +bool contextsPublic; +int contextsRecent = 500; + const char *ContextsQuery = SQL( WITH recentEvents AS ( SELECT time, context @@ -45,8 +49,8 @@ const char *ContextsQuery = SQL( SELECT name, query, 0 FROM allContexts; ); -enum kcgi_err pageContexts(struct kreq *req) { - struct Scope scope = htmlScope(req); +enum kcgi_err contextsPage(struct kreq *req) { + struct Scope scope = pageScope(req); if (!scope.network) return httpFail(req, KHTTP_400); enum kcgi_err error = httpHead(req, KHTTP_200, KMIME_TEXT_HTML); @@ -62,8 +66,8 @@ enum kcgi_err pageContexts(struct kreq *req) { sqlite3_reset(stmt.contexts); dbBindText(stmt.contexts, ":network", scope.network); - dbBindInt(stmt.contexts, ":recent", pageRecent); - dbBindInt(stmt.contexts, ":public", pagePublic); + dbBindInt(stmt.contexts, ":recent", contextsRecent); + dbBindInt(stmt.contexts, ":public", contextsPublic); enum State { None, |