diff options
| author | green <dandelions@disroot.org> | 2026-01-24 23:37:55 +0100 |
|---|---|---|
| committer | green <dandelions@disroot.org> | 2026-01-24 23:56:45 +0100 |
| commit | cd96b83828a852bdf4f4311900501eba8c3972ca (patch) | |
| tree | 0a572f2c368e3ae66c24ddbc7add1ccba516a524 | |
| parent | cc013a5af8a661a954a15bf46a2feb17d8574855 (diff) | |
poll-limits: added "max_poll_option_length" option
| -rw-r--r-- | activitypub.c | 7 |
1 files 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"); |