commit 1787102
default
·
2025-02-07 08:41:31 +0000 UTC
parent cfe73e1
mastoapi: notify the maximum configured attachments.
1 files changed,
+6,
-1
+6,
-1
1@@ -2171,7 +2171,12 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
2
3 {
4 xs *d11 = xs_json_loads("{\"characters_reserved_per_url\":32,"
5- "\"max_characters\":100000,\"max_media_attachments\":8}");
6+ "\"max_characters\":100000,\"max_media_attachments\":4}");
7+
8+ const xs_number *max_attachments = xs_dict_get(srv_config, "max_attachments");
9+ if (xs_type(max_attachments) == XSTYPE_NUMBER)
10+ d11 = xs_dict_set(d11, "max_media_attachments", max_attachments);
11+
12 cfg = xs_dict_append(cfg, "statuses", d11);
13
14 xs *d12 = xs_json_loads("{\"max_featured_tags\":0}");