commit 7f60472

default  ·  2025-01-01 12:37:35 +0000 UTC
parent d135b3d
The shared post is really sent.
2 files changed,  +12, -3
M html.c
M html.c
+11, -2
 1@@ -3514,9 +3514,18 @@ int html_get_handler(const xs_dict *req, const char *q_path,
 2             status = HTTP_STATUS_UNAUTHORIZED;
 3         }
 4         else {
 5-            const char *content = xs_dict_get(q_vars, "content");
 6+            const char *b64 = xs_dict_get(q_vars, "content");
 7+            int sz;
 8+            xs *content = xs_base64_dec(b64, &sz);
 9+            xs *msg = msg_note(&snac, content, NULL, NULL, NULL, 0);
10+            xs *c_msg = msg_create(&snac, msg);
11+
12+            timeline_add(&snac, xs_dict_get(msg, "id"), msg);
13+
14+            enqueue_message(&snac, c_msg);
15+
16+            snac_debug(&snac, 1, xs_fmt("web action 'share' received"));
17 
18-            srv_log(xs_fmt("shared post %s", content));
19             *body   = xs_fmt("%s/admin", snac.actor);
20             *b_size = strlen(*body);
21             status  = HTTP_STATUS_SEE_OTHER;
+1, -1
1@@ -282,7 +282,7 @@ int server_get_handler(xs_dict *req, const char *q_path,
2         xs *s = NULL;
3 
4         if (xs_type(text) == XSTYPE_STRING)
5-            s = xs_fmt("%s\n\n%s\n", text, url);
6+            s = xs_fmt("%s:\n\n%s\n", text, url);
7         else
8             s = xs_fmt("%s\n", url);
9