diff options
| author | 2025-01-05 16:53:30 +0100 | |
|---|---|---|
| committer | 2025-01-05 16:53:30 +0100 | |
| commit | 9fcff1467e0eb4a095373de5f27e10fa8200fa16 (patch) | |
| tree | 15fca66ed82433ab4406b861590c0c454ab296eb | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | penes-snac2-9fcff1467e0eb4a095373de5f27e10fa8200fa16.tar.gz penes-snac2-9fcff1467e0eb4a095373de5f27e10fa8200fa16.tar.xz penes-snac2-9fcff1467e0eb4a095373de5f27e10fa8200fa16.zip | |
New configuration directive "max_public_entries".
| -rw-r--r-- | activitypub.c | 6 | ||||
| -rw-r--r-- | html.c | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/activitypub.c b/activitypub.c index ea4d8ea..1ae5ad9 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -2919,12 +2919,12 @@ int activitypub_get_handler(const xs_dict *req, const char *q_path, | |||
| 2919 | xs *id = xs_fmt("%s/%s", snac.actor, p_path); | 2919 | xs *id = xs_fmt("%s/%s", snac.actor, p_path); |
| 2920 | xs *list = xs_list_new(); | 2920 | xs *list = xs_list_new(); |
| 2921 | const char *v; | 2921 | const char *v; |
| 2922 | int tc = 0; | 2922 | int cnt = xs_number_get(xs_dict_get_def(srv_config, "max_public_entries", "20")); |
| 2923 | 2923 | ||
| 2924 | /* get the public outbox or the pinned list */ | 2924 | /* get the public outbox or the pinned list */ |
| 2925 | xs *elems = *p_path == 'o' ? timeline_simple_list(&snac, "public", 0, 20) : pinned_list(&snac); | 2925 | xs *elems = *p_path == 'o' ? timeline_simple_list(&snac, "public", 0, cnt) : pinned_list(&snac); |
| 2926 | 2926 | ||
| 2927 | while (xs_list_next(elems, &v, &tc)) { | 2927 | xs_list_foreach(elems, v) { |
| 2928 | xs *i = NULL; | 2928 | xs *i = NULL; |
| 2929 | 2929 | ||
| 2930 | if (valid_status(object_get_by_md5(v, &i))) { | 2930 | if (valid_status(object_get_by_md5(v, &i))) { |
| @@ -3423,7 +3423,9 @@ int html_get_handler(const xs_dict *req, const char *q_path, | |||
| 3423 | if (xs_type(xs_dict_get(snac.config, "private")) == XSTYPE_TRUE) | 3423 | if (xs_type(xs_dict_get(snac.config, "private")) == XSTYPE_TRUE) |
| 3424 | return HTTP_STATUS_FORBIDDEN; | 3424 | return HTTP_STATUS_FORBIDDEN; |
| 3425 | 3425 | ||
| 3426 | xs *elems = timeline_simple_list(&snac, "public", 0, 20); | 3426 | int cnt = xs_number_get(xs_dict_get_def(srv_config, "max_public_entries", "20")); |
| 3427 | |||
| 3428 | xs *elems = timeline_simple_list(&snac, "public", 0, cnt); | ||
| 3427 | xs *bio = xs_dup(xs_dict_get(snac.config, "bio")); | 3429 | xs *bio = xs_dup(xs_dict_get(snac.config, "bio")); |
| 3428 | 3430 | ||
| 3429 | xs *rss_title = xs_fmt("%s (@%s@%s)", | 3431 | xs *rss_title = xs_fmt("%s (@%s@%s)", |