From 932227bbac7fe740bff1e38bf92b58edef19e32f Mon Sep 17 00:00:00 2001 From: default Date: Wed, 8 Jan 2025 16:59:14 +0100 Subject: Bumped copyright year. --- httpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httpd.c') diff --git a/httpd.c b/httpd.c index 163f98a..dda40b9 100644 --- a/httpd.c +++ b/httpd.c @@ -1,5 +1,5 @@ /* snac - A simple, minimalistic ActivityPub instance */ -/* copyright (c) 2022 - 2024 grunfink et al. / MIT license */ +/* copyright (c) 2022 - 2025 grunfink et al. / MIT license */ #include "xs.h" #include "xs_io.h" -- cgit v1.2.3 From b993e26346f885586ff0533a3b309ed7d1e910cf Mon Sep 17 00:00:00 2001 From: default Date: Thu, 16 Jan 2025 14:20:07 +0100 Subject: Implemented Mastodon-like /authorize_interaction. --- httpd.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'httpd.c') diff --git a/httpd.c b/httpd.c index dda40b9..74628e3 100644 --- a/httpd.c +++ b/httpd.c @@ -182,6 +182,29 @@ const char *share_page = "" ""; +const char *authorize_interaction_page = "" +"\n" +"\n" +"
\n" +"%s
\n" +""; + + int server_get_handler(xs_dict *req, const char *q_path, char **body, int *b_size, char **ctype) /* basic server services */ @@ -318,6 +341,25 @@ int server_get_handler(xs_dict *req, const char *q_path, USER_AGENT ); } + else + if (strcmp(q_path, "/authorize_interaction") == 0) { + const xs_dict *q_vars = xs_dict_get(req, "q_vars"); + const char *uri = xs_dict_get(q_vars, "uri"); + + if (xs_is_string(uri)) { + status = HTTP_STATUS_OK; + *ctype = "text/html; charset=utf-8"; + *body = xs_fmt(authorize_interaction_page, + xs_dict_get(srv_config, "host"), + srv_baseurl, + xs_dict_get(srv_config, "host"), + srv_baseurl, + uri, + uri, + USER_AGENT + ); + } + } if (status != 0) srv_debug(1, xs_fmt("server_get_handler serving '%s' %d", q_path, status)); -- cgit v1.2.3 From 04803b628b44acb773ff972a4c12071cbcf49b23 Mon Sep 17 00:00:00 2001 From: default Date: Thu, 16 Jan 2025 18:19:19 +0100 Subject: Changed Boost/Like order in the /authorize_interaction page. --- httpd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httpd.c') diff --git a/httpd.c b/httpd.c index 74628e3..7222893 100644 --- a/httpd.c +++ b/httpd.c @@ -195,8 +195,8 @@ const char *authorize_interaction_page = "" "