summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--httpd.c5
-rw-r--r--mastoapi.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/httpd.c b/httpd.c
index 11f2c28..3168323 100644
--- a/httpd.c
+++ b/httpd.c
@@ -183,17 +183,21 @@ void httpd_connection(FILE *f)
if (status == 0)
status = activitypub_get_handler(req, q_path, &body, &b_size, &ctype);
+#ifndef NO_MASTODON_API
if (status == 0)
status = oauth_get_handler(req, q_path, &body, &b_size, &ctype);
if (status == 0)
status = mastoapi_get_handler(req, q_path, &body, &b_size, &ctype);
+#endif /* NO_MASTODON_API */
if (status == 0)
status = html_get_handler(req, q_path, &body, &b_size, &ctype);
}
else
if (strcmp(method, "POST") == 0) {
+
+#ifndef NO_MASTODON_API
if (status == 0)
status = oauth_post_handler(req, q_path,
payload, p_size, &body, &b_size, &ctype);
@@ -201,6 +205,7 @@ void httpd_connection(FILE *f)
if (status == 0)
status = mastoapi_post_handler(req, q_path,
payload, p_size, &body, &b_size, &ctype);
+#endif
if (status == 0)
status = activitypub_post_handler(req, q_path,
diff --git a/mastoapi.c b/mastoapi.c
index 6e5fe09..3858e13 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -1,6 +1,8 @@
/* snac - A simple, minimalistic ActivityPub instance */
/* copyright (c) 2022 - 2023 grunfink / MIT license */
+#ifndef NO_MASTODON_API
+
#include "xs.h"
#include "xs_encdec.h"
#include "xs_openssl.h"
@@ -1453,3 +1455,5 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
return status;
}
+
+#endif /* #ifndef NO_MASTODON_API */