From cd96b83828a852bdf4f4311900501eba8c3972ca Mon Sep 17 00:00:00 2001 From: green Date: Sat, 24 Jan 2026 23:37:55 +0100 Subject: poll-limits: added "max_poll_option_length" option --- activitypub.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/activitypub.c b/activitypub.c index e9e28be..8eb7844 100644 --- a/activitypub.c +++ b/activitypub.c @@ -2322,13 +2322,16 @@ xs_dict *msg_question(snac *user, const char *content, xs_list *attach, /* creates a Question message */ { xs_dict *msg = msg_note(user, content, NULL, NULL, attach, 0, NULL, NULL); - size_t max_line = 200; - int max = 8; const xs_number *max_options = xs_dict_get(srv_config, "max_poll_options"); + const xs_number *max_length = xs_dict_get(srv_config, "max_poll_option_length"); xs_set seen; + size_t max_line = 60; + int max = 8; if (xs_type(max_options) == XSTYPE_NUMBER) max = xs_number_get(max_options); + if (xs_type(max_length) == XSTYPE_NUMBER) + max_line = xs_number_get(max_length); msg = xs_dict_set(msg, "type", "Question"); -- cgit v1.2.3