commit ce8e11a
green
·
2025-05-05 20:52:50 +0000 UTC
parent 207d9e0
personal: bigger limit for polls
2 files changed,
+13,
-3
M
html.c
+3,
-2
1@@ -2321,6 +2321,7 @@ xs_dict *msg_question(snac *user, const char *content, xs_list *attach,
2 /* creates a Question message */
3 {
4 xs_dict *msg = msg_note(user, content, NULL, NULL, attach, 0, NULL, NULL);
5+ int max_line = 200;
6 int max = 8;
7 const xs_number *max_options = xs_dict_get(srv_config, "max_poll_options");
8 xs_set seen;
9@@ -2345,8 +2346,8 @@ xs_dict *msg_question(snac *user, const char *content, xs_list *attach,
10 xs *v2 = xs_dup(v);
11 xs *d = xs_dict_new();
12
13- if (strlen(v2) > 60) {
14- v2[60] = '\0';
15+ if (strlen(v2) > max_line) {
16+ v2[max_line] = '\0';
17 v2 = xs_str_cat(v2, "...");
18 }
19
M
html.c
+10,
-1
1@@ -817,7 +817,13 @@ xs_html *html_note(snac *user, const char *summary,
2 xs_html_text(L("End in 1 hour"))),
3 xs_html_tag("option",
4 xs_html_attr("value", "86400"),
5- xs_html_text(L("End in 1 day"))))));
6+ xs_html_text(L("End in 1 day"))),
7+ xs_html_tag("option",
8+ xs_html_attr("value", "259200"),
9+ xs_html_text(L("End in 3 days"))),
10+ xs_html_tag("option",
11+ xs_html_attr("value", "31536000"),
12+ xs_html_text(L("End in 1 year"))))));
13 }
14
15 xs_html_add(form,
16@@ -3207,6 +3213,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
17 xs_html *add_hashtags = xs_html_tag("ul",
18 xs_html_attr("class", "snac-more-hashtags"));
19
20+ // todo: wafrn hashtags
21 xs_list_foreach(tags, tag) {
22 const char *type = xs_dict_get(tag, "type");
23
24@@ -3857,6 +3864,8 @@ xs_html *html_people_list(snac *user, xs_list *list, const char *header, const c
25 xs_free(xs_html_render(snac_metadata));
26 }
27
28+ // todo: add metadata from "attachemnt"->"PropertyValue"
29+
30 /* buttons */
31 xs *btn_form_action = xs_fmt("%s/admin/action", user->actor);
32