Explorar el Código

mastoapi: notify the maximum configured attachments.

default hace 1 mes
padre
commit
1787102870
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      mastoapi.c

+ 6 - 1
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}");