diff options
| -rw-r--r-- | html.c | 13 | ||||
| -rw-r--r-- | httpd.c | 2 |
2 files changed, 12 insertions, 3 deletions
| @@ -3514,9 +3514,18 @@ int html_get_handler(const xs_dict *req, const char *q_path, | |||
| 3514 | status = HTTP_STATUS_UNAUTHORIZED; | 3514 | status = HTTP_STATUS_UNAUTHORIZED; |
| 3515 | } | 3515 | } |
| 3516 | else { | 3516 | else { |
| 3517 | const char *content = xs_dict_get(q_vars, "content"); | 3517 | const char *b64 = xs_dict_get(q_vars, "content"); |
| 3518 | int sz; | ||
| 3519 | xs *content = xs_base64_dec(b64, &sz); | ||
| 3520 | xs *msg = msg_note(&snac, content, NULL, NULL, NULL, 0); | ||
| 3521 | xs *c_msg = msg_create(&snac, msg); | ||
| 3522 | |||
| 3523 | timeline_add(&snac, xs_dict_get(msg, "id"), msg); | ||
| 3524 | |||
| 3525 | enqueue_message(&snac, c_msg); | ||
| 3526 | |||
| 3527 | snac_debug(&snac, 1, xs_fmt("web action 'share' received")); | ||
| 3518 | 3528 | ||
| 3519 | srv_log(xs_fmt("shared post %s", content)); | ||
| 3520 | *body = xs_fmt("%s/admin", snac.actor); | 3529 | *body = xs_fmt("%s/admin", snac.actor); |
| 3521 | *b_size = strlen(*body); | 3530 | *b_size = strlen(*body); |
| 3522 | status = HTTP_STATUS_SEE_OTHER; | 3531 | status = HTTP_STATUS_SEE_OTHER; |
| @@ -282,7 +282,7 @@ int server_get_handler(xs_dict *req, const char *q_path, | |||
| 282 | xs *s = NULL; | 282 | xs *s = NULL; |
| 283 | 283 | ||
| 284 | if (xs_type(text) == XSTYPE_STRING) | 284 | if (xs_type(text) == XSTYPE_STRING) |
| 285 | s = xs_fmt("%s\n\n%s\n", text, url); | 285 | s = xs_fmt("%s:\n\n%s\n", text, url); |
| 286 | else | 286 | else |
| 287 | s = xs_fmt("%s\n", url); | 287 | s = xs_fmt("%s\n", url); |
| 288 | 288 | ||