From 78ec3b077b989bcae5950d75f4ee0cb03bd10030 Mon Sep 17 00:00:00 2001
From: default
Date: Mon, 10 Oct 2022 09:03:07 +0200
Subject: Media can be attached to notes.
The web interface limits this (by now) to only one
attachment, given the URL.
---
html.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
(limited to 'html.c')
diff --git a/html.c b/html.c
index 167d685..a6b6f0e 100644
--- a/html.c
+++ b/html.c
@@ -195,6 +195,7 @@ d_char *html_top_controls(snac *snac, d_char *s)
"rows=\"8\" wrap=\"virtual\" required=\"required\">\n"
"\n"
"\n"
+ " Image URL"
"
\n"
"\n"
@@ -204,12 +205,12 @@ d_char *html_top_controls(snac *snac, d_char *s)
"
\n"
+ "\n"
"
\n"
+ "\n"
"%s
\n"
@@ -222,7 +223,7 @@ d_char *html_top_controls(snac *snac, d_char *s)
"
\n"
"%s:
\n"
- "
\n"
+ "\n"
"%s:
\n"
"
\n"
@@ -854,16 +855,24 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
p_vars = xs_dict_get(req, "p_vars");
+#if 0
+ {
+ xs *j1 = xs_json_dumps_pp(p_vars, 4);
+ printf("%s\n", j1);
+ }
+#endif
+
if (p_path && strcmp(p_path, "admin/note") == 0) {
/* post note */
char *content = xs_dict_get(p_vars, "content");
char *in_reply_to = xs_dict_get(p_vars, "in_reply_to");
+ char *attach_url = xs_dict_get(p_vars, "attach_url");
if (content != NULL) {
xs *msg = NULL;
xs *c_msg = NULL;
- msg = msg_note(&snac, content, NULL, in_reply_to);
+ msg = msg_note(&snac, content, NULL, in_reply_to, attach_url);
c_msg = msg_create(&snac, msg);
--
cgit v1.2.3