commit 4e7bc6c
grunfink
·
2026-03-04 15:00:47 +0000 UTC
parent d91c99a
Fixed bug in Mastodon-style share button.
1 files changed,
+2,
-2
M
html.c
M
html.c
+2,
-2
1@@ -4542,7 +4542,6 @@ int html_get_handler(const xs_dict *req, const char *q_path,
2
3 if (xs_type(login) == XSTYPE_STRING && xs_type(content) == XSTYPE_STRING) {
4 xs *b64 = xs_base64_enc(content, strlen(content));
5-
6 srv_log(xs_fmt("share-bridge for user '%s'", login));
7
8 *body = xs_fmt("%s/%s/share?content=%s", srv_baseurl, login, b64);
9@@ -5191,8 +5190,9 @@ int html_get_handler(const xs_dict *req, const char *q_path,
10 }
11 else {
12 const char *b64 = xs_dict_get(q_vars, "content");
13+ xs *b64_2 = xs_replace(b64, " ", "+");
14 int sz;
15- xs *content = xs_base64_dec(b64, &sz);
16+ xs *content = xs_base64_dec(b64_2, &sz);
17 xs *msg = msg_note(&snac, content, NULL, NULL, NULL, 0, NULL, NULL);
18 xs *c_msg = msg_create(&snac, msg);
19