aboutsummaryrefslogtreecommitdiff
path: root/ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'ctl.c')
-rw-r--r--ctl.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ctl.c b/ctl.c
index fbc9e63..51809db 100644
--- a/ctl.c
+++ b/ctl.c
@@ -19,6 +19,20 @@ printdate(int timestamp)
}
void
+showattachment(id)
+{
+ struct attachment *attachment;
+
+ if(!(attachment = getattachment(byid("attachments", id), 1))){
+ srverr("Could not retrieve attachment");
+ return;
+ }
+
+ printf("Content-Type: %s\n\n", attachment->mime);
+ printf("%.*s", attachment->bytes, attachment->data);
+}
+
+void
showfront()
{
char *title;
@@ -42,6 +56,7 @@ showpost(int id)
char *title;
struct post *post;
struct user *user;
+ sqlite3_stmt *stmt;
if(!(post = getpost(byid("posts", id), 1))){
srverr("Could not retrieve post");
@@ -53,6 +68,8 @@ showpost(int id)
return;
}
+ stmt = byid("attachments", id);
+
title = site.name;
printf("Content-Type: text/html\n\n");
#include "t/post.tc"