diff options
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 13 |
1 files changed, 11 insertions, 2 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; |