From 82bcc4b465f73a5d1f2eebcf3813452bc1c37fbd Mon Sep 17 00:00:00 2001 From: default Date: Mon, 27 Jan 2025 16:59:08 +0100 Subject: Minor optimization in timeline retrieving. Functions now receive an optional int *more, set to 1 if there are more than the 'show' requested. --- mastoapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mastoapi.c') diff --git a/mastoapi.c b/mastoapi.c index 54b4333..3c445c2 100644 --- a/mastoapi.c +++ b/mastoapi.c @@ -1676,7 +1676,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, else if (strcmp(opt, "statuses") == 0) { /** **/ /* the public list of posts of a user */ - xs *timeline = timeline_simple_list(&snac2, "public", 0, 256); + xs *timeline = timeline_simple_list(&snac2, "public", 0, 256, NULL); xs_list *p = timeline; const xs_str *v; -- cgit v1.2.3 From 1787102870161914fa7ba19d16803ebf7050b7dd Mon Sep 17 00:00:00 2001 From: default Date: Fri, 7 Feb 2025 09:41:31 +0100 Subject: mastoapi: notify the maximum configured attachments. --- mastoapi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mastoapi.c') diff --git a/mastoapi.c b/mastoapi.c index 3c445c2..797a4da 100644 --- a/mastoapi.c +++ b/mastoapi.c @@ -2171,7 +2171,12 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, { xs *d11 = xs_json_loads("{\"characters_reserved_per_url\":32," - "\"max_characters\":100000,\"max_media_attachments\":8}"); + "\"max_characters\":100000,\"max_media_attachments\":4}"); + + const xs_number *max_attachments = xs_dict_get(srv_config, "max_attachments"); + if (xs_type(max_attachments) == XSTYPE_NUMBER) + d11 = xs_dict_set(d11, "max_media_attachments", max_attachments); + cfg = xs_dict_append(cfg, "statuses", d11); xs *d12 = xs_json_loads("{\"max_featured_tags\":0}"); -- cgit v1.2.3