diff options
| author | 2025-05-05 22:52:50 +0200 | |
|---|---|---|
| committer | 2026-01-24 02:23:16 +0100 | |
| commit | ce8e11adc74015931d9adac6f3b108e7ec31fbf5 (patch) | |
| tree | 927fc01463a59546e4ce0704e345e852f04b87b2 /activitypub.c | |
| parent | small: fix segfault for poll options (diff) | |
| download | snac2-ce8e11adc74015931d9adac6f3b108e7ec31fbf5.tar.gz snac2-ce8e11adc74015931d9adac6f3b108e7ec31fbf5.tar.xz snac2-ce8e11adc74015931d9adac6f3b108e7ec31fbf5.zip | |
personal: bigger limit for polls
Diffstat (limited to 'activitypub.c')
| -rw-r--r-- | activitypub.c | 5 |
1 files changed, 3 insertions, 2 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 | ||