summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
Diffstat (limited to 'html.c')
-rw-r--r--html.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/html.c b/html.c
index 7aede65..7a388a1 100644
--- a/html.c
+++ b/html.c
@@ -1352,11 +1352,22 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
1352 char *to = xs_dict_get(p_vars, "to"); 1352 char *to = xs_dict_get(p_vars, "to");
1353 char *sensitive = xs_dict_get(p_vars, "sensitive"); 1353 char *sensitive = xs_dict_get(p_vars, "sensitive");
1354 char *edit_id = xs_dict_get(p_vars, "edit_id"); 1354 char *edit_id = xs_dict_get(p_vars, "edit_id");
1355 char *alt_text = xs_dict_get(p_vars, "alt_text");
1355 xs *attach_list = xs_list_new(); 1356 xs *attach_list = xs_list_new();
1356 1357
1358 /* default alt text */
1359 if (xs_is_null(alt_text))
1360 alt_text = "";
1361
1357 /* is attach_url set? */ 1362 /* is attach_url set? */
1358 if (!xs_is_null(attach_url) && *attach_url != '\0') 1363 if (!xs_is_null(attach_url) && *attach_url != '\0') {
1359 attach_list = xs_list_append(attach_list, attach_url); 1364 xs *l = xs_list_new();
1365
1366 l = xs_list_append(l, attach_url);
1367 l = xs_list_append(l, alt_text);
1368
1369 attach_list = xs_list_append(attach_list, l);
1370 }
1360 1371
1361 /* is attach_file set? */ 1372 /* is attach_file set? */
1362 if (!xs_is_null(attach_file) && xs_type(attach_file) == XSTYPE_LIST) { 1373 if (!xs_is_null(attach_file) && xs_type(attach_file) == XSTYPE_LIST) {
@@ -1373,7 +1384,12 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
1373 /* store */ 1384 /* store */
1374 static_put(&snac, id, payload + fo, fs); 1385 static_put(&snac, id, payload + fo, fs);
1375 1386
1376 attach_list = xs_list_append(attach_list, url); 1387 xs *l = xs_list_new();
1388
1389 l = xs_list_append(l, url);
1390 l = xs_list_append(l, alt_text);
1391
1392 attach_list = xs_list_append(attach_list, l);
1377 } 1393 }
1378 } 1394 }
1379 1395