aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2025-01-01 13:37:35 +0100
committerdefault <nobody@localhost>2025-01-01 13:37:35 +0100
commit7f6047268e915a3d8fac07103445d6e3fcc7ecc0 (patch)
tree147e0562bb570c85c31285618d32415ba46a178a
parentd135b3d8f0a90a2d3fbf1136a834a761349f0bd6 (diff)
The shared post is really sent.
-rw-r--r--html.c13
-rw-r--r--httpd.c2
2 files changed, 12 insertions, 3 deletions
diff --git a/html.c b/html.c
index 35d3b21..a04e148 100644
--- a/html.c
+++ b/html.c
@@ -3514,9 +3514,18 @@ int html_get_handler(const xs_dict *req, const char *q_path,
status = HTTP_STATUS_UNAUTHORIZED;
}
else {
- const char *content = xs_dict_get(q_vars, "content");
+ const char *b64 = xs_dict_get(q_vars, "content");
+ int sz;
+ xs *content = xs_base64_dec(b64, &sz);
+ xs *msg = msg_note(&snac, content, NULL, NULL, NULL, 0);
+ xs *c_msg = msg_create(&snac, msg);
+
+ timeline_add(&snac, xs_dict_get(msg, "id"), msg);
+
+ enqueue_message(&snac, c_msg);
+
+ snac_debug(&snac, 1, xs_fmt("web action 'share' received"));
- srv_log(xs_fmt("shared post %s", content));
*body = xs_fmt("%s/admin", snac.actor);
*b_size = strlen(*body);
status = HTTP_STATUS_SEE_OTHER;
diff --git a/httpd.c b/httpd.c
index 626ae9d..3d0d110 100644
--- a/httpd.c
+++ b/httpd.c
@@ -282,7 +282,7 @@ int server_get_handler(xs_dict *req, const char *q_path,
xs *s = NULL;
if (xs_type(text) == XSTYPE_STRING)
- s = xs_fmt("%s\n\n%s\n", text, url);
+ s = xs_fmt("%s:\n\n%s\n", text, url);
else
s = xs_fmt("%s\n", url);