summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar green2025-05-05 22:52:50 +0200
committerGravatar green2026-01-24 02:23:16 +0100
commitce8e11adc74015931d9adac6f3b108e7ec31fbf5 (patch)
tree927fc01463a59546e4ce0704e345e852f04b87b2
parentsmall: fix segfault for poll options (diff)
downloadsnac2-ce8e11adc74015931d9adac6f3b108e7ec31fbf5.tar.gz
snac2-ce8e11adc74015931d9adac6f3b108e7ec31fbf5.tar.xz
snac2-ce8e11adc74015931d9adac6f3b108e7ec31fbf5.zip
personal: bigger limit for polls
-rw-r--r--activitypub.c5
-rw-r--r--html.c11
2 files changed, 13 insertions, 3 deletions
diff --git a/activitypub.c b/activitypub.c
index 2890a94..8964030 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -2321,6 +2321,7 @@ xs_dict *msg_question(snac *user, const char *content, xs_list *attach,
2321/* creates a Question message */ 2321/* creates a Question message */
2322{ 2322{
2323 xs_dict *msg = msg_note(user, content, NULL, NULL, attach, 0, NULL, NULL); 2323 xs_dict *msg = msg_note(user, content, NULL, NULL, attach, 0, NULL, NULL);
2324 int max_line = 200;
2324 int max = 8; 2325 int max = 8;
2325 const xs_number *max_options = xs_dict_get(srv_config, "max_poll_options"); 2326 const xs_number *max_options = xs_dict_get(srv_config, "max_poll_options");
2326 xs_set seen; 2327 xs_set seen;
@@ -2345,8 +2346,8 @@ xs_dict *msg_question(snac *user, const char *content, xs_list *attach,
2345 xs *v2 = xs_dup(v); 2346 xs *v2 = xs_dup(v);
2346 xs *d = xs_dict_new(); 2347 xs *d = xs_dict_new();
2347 2348
2348 if (strlen(v2) > 60) { 2349 if (strlen(v2) > max_line) {
2349 v2[60] = '\0'; 2350 v2[max_line] = '\0';
2350 v2 = xs_str_cat(v2, "..."); 2351 v2 = xs_str_cat(v2, "...");
2351 } 2352 }
2352 2353
diff --git a/html.c b/html.c
index 9de51d1..77ffda9 100644
--- a/html.c
+++ b/html.c
@@ -817,7 +817,13 @@ xs_html *html_note(snac *user, const char *summary,
817 xs_html_text(L("End in 1 hour"))), 817 xs_html_text(L("End in 1 hour"))),
818 xs_html_tag("option", 818 xs_html_tag("option",
819 xs_html_attr("value", "86400"), 819 xs_html_attr("value", "86400"),
820 xs_html_text(L("End in 1 day")))))); 820 xs_html_text(L("End in 1 day"))),
821 xs_html_tag("option",
822 xs_html_attr("value", "259200"),
823 xs_html_text(L("End in 3 days"))),
824 xs_html_tag("option",
825 xs_html_attr("value", "31536000"),
826 xs_html_text(L("End in 1 year"))))));
821 } 827 }
822 828
823 xs_html_add(form, 829 xs_html_add(form,
@@ -3207,6 +3213,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
3207 xs_html *add_hashtags = xs_html_tag("ul", 3213 xs_html *add_hashtags = xs_html_tag("ul",
3208 xs_html_attr("class", "snac-more-hashtags")); 3214 xs_html_attr("class", "snac-more-hashtags"));
3209 3215
3216 // todo: wafrn hashtags
3210 xs_list_foreach(tags, tag) { 3217 xs_list_foreach(tags, tag) {
3211 const char *type = xs_dict_get(tag, "type"); 3218 const char *type = xs_dict_get(tag, "type");
3212 3219
@@ -3857,6 +3864,8 @@ xs_html *html_people_list(snac *user, xs_list *list, const char *header, const c
3857 xs_free(xs_html_render(snac_metadata)); 3864 xs_free(xs_html_render(snac_metadata));
3858 } 3865 }
3859 3866
3867 // todo: add metadata from "attachemnt"->"PropertyValue"
3868
3860 /* buttons */ 3869 /* buttons */
3861 xs *btn_form_action = xs_fmt("%s/admin/action", user->actor); 3870 xs *btn_form_action = xs_fmt("%s/admin/action", user->actor);
3862 3871