summary refs log tree commit diff
path: root/contexts.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-07-09 20:14:27 -0400
committerJune McEnroe <june@causal.agency>2020-07-09 20:14:27 -0400
commitfb214d0c8096a345f5da30900d9ced0aa777cdc3 (patch)
tree8458f7beca535e49ed531880b32fefc194d7de8b /contexts.c
parentAdd events page stub (diff)
downloadscooper-fb214d0c8096a345f5da30900d9ced0aa777cdc3.tar.gz
scooper-fb214d0c8096a345f5da30900d9ced0aa777cdc3.zip
Implement very basic events listing
Diffstat (limited to 'contexts.c')
-rw-r--r--contexts.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/contexts.c b/contexts.c
index c75202a..d432cb1 100644
--- a/contexts.c
+++ b/contexts.c
@@ -29,7 +29,7 @@ const char *ContextsQuery = SQL(
 );
 
 enum kcgi_err pageContexts(struct kreq *req) {
-	if (!req->fieldmap[Network]) return httpFail(req, KHTTP_404);
+	if (!req->fieldmap[Network]) return httpFail(req, KHTTP_400);
 	enum kcgi_err error = httpHead(req, KHTTP_200, KMIME_TEXT_HTML);
 	if (req->method == KMETHOD_HEAD) return error;
 
@@ -59,7 +59,8 @@ enum kcgi_err pageContexts(struct kreq *req) {
 		);
 		if (!href) err(EX_OSERR, "khttp_urlpart");
 
-		error = khtml_elem(&html, KELEM_LI)
+		error = 0
+			|| khtml_elem(&html, KELEM_LI)
 			|| khtml_attr(&html, KELEM_A, KATTR_HREF, href, KATTR__MAX)
 			|| khtml_puts(&html, context)
 			|| khtml_closeelem(&html, 2);
d5aedc3d84eea0d970f90ddc04f9be331e9c20e9&follow=1'>Make clientFormat publicJune McEnroe 2019-10-24Make serverFormat publicJune McEnroe 2019-10-24Rename some thingsJune McEnroe 2019-10-23Add ISUPPORT draft to STANDARDSJune McEnroe 2019-10-23Track own originJune McEnroe 2019-10-23Track channels and sync ISUPPORTJune McEnroe 2019-10-23Track nick changesJune McEnroe 2019-10-23Rename Command to MessageJune McEnroe 2019-10-23Synchronize state after client registrationJune McEnroe 2019-10-23Send to server if client has no needsJune McEnroe 2019-10-23Implement some amount of client connectionJune McEnroe 2019-10-23Set clients non-blockingJune McEnroe 2019-10-23Clean up state.c and factor out parsingJune McEnroe 2019-10-23Respond to pingsJune McEnroe 2019-10-23Add verbose flagJune McEnroe 2019-10-23Set NOSIGPIPE on server connectionJune McEnroe 2019-10-23Set an initial loop capJune McEnroe 2019-10-23Fix rest parsingJune McEnroe 2019-10-23Add dynamic poll listJune McEnroe 2019-10-23Don't assume commands have targets and handle ERRORJune McEnroe 2019-10-23Clean up state somewhatJune McEnroe 2019-10-23Actually send the buffer...June McEnroe 2019-10-23Add stateJune McEnroe