commit cd96b83

green  ·  2026-01-24 22:37:55 +0000 UTC
parent cc013a5
poll-limits: added "max_poll_option_length" option
1 files changed,  +5, -2
+5, -2
 1@@ -2322,13 +2322,16 @@ 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-    size_t max_line = 200;
 6-    int max = 8;
 7     const xs_number *max_options = xs_dict_get(srv_config, "max_poll_options");
 8+    const xs_number *max_length = xs_dict_get(srv_config, "max_poll_option_length");
 9     xs_set seen;
10 
11+    size_t max_line = 60;
12+    int max = 8;
13     if (xs_type(max_options) == XSTYPE_NUMBER)
14         max = xs_number_get(max_options);
15+    if (xs_type(max_length) == XSTYPE_NUMBER)
16+        max_line = xs_number_get(max_length);
17 
18     msg = xs_dict_set(msg, "type", "Question");
19