commit ac3b5dc

Louis Brauer  ·  2024-05-30 22:38:05 +0000 UTC
parents c3bcb2b, eed9324
Merge branch 'master' into announcements
4 files changed,  +24, -2
M html.c
+6, -0
 1@@ -4,8 +4,14 @@
 2 
 3 Markdown-style links are now supported.
 4 
 5+The alt text in attachments that have one is also shown in a dropdown just below it (useful for environments where mouseover is not available, i.e. for phones and tablets).
 6+
 7 The avatar and/or the header images can now be deleted (contributed by louis77).
 8 
 9+Code cleaning: HTTP status codes use names instead of hardcoded integers (contributed by louis77).
10+
11+Mastodon API: some fixes for Mona and Tokodon apps, user credentials can now be edited from apps (contributed by louis77).
12+
13 The webfinger content-type response header is now RFC-compliant (contributed by steve-bate).
14 
15 ## 2.53
+1, -1
1@@ -239,7 +239,7 @@ xs_list *get_attachments(const xs_dict *msg)
2             if (xs_is_null(name))
3                 name = xs_dict_get(msg, "name");
4             if (xs_is_null(name))
5-                name = L("No description");
6+                name = "";
7 
8             xs *d = xs_dict_new();
9             d = xs_dict_append(d, "type", type);
M html.c
+16, -0
 1@@ -1909,6 +1909,9 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
 2                         xs_html_tag("a",
 3                             xs_html_attr("href", href),
 4                             xs_html_text(href))));
 5+
 6+                /* do not generate an Alt... */
 7+                name = NULL;
 8             }
 9             else {
10                 xs_html_add(content_attachments,
11@@ -1918,6 +1921,19 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only,
12                             xs_html_text(L("Attachment")),
13                             xs_html_text(": "),
14                             xs_html_text(href))));
15+
16+                /* do not generate an Alt... */
17+                name = NULL;
18+            }
19+
20+            if (name != NULL && *name) {
21+                xs_html_add(content_attachments,
22+                    xs_html_tag("p",
23+                        xs_html_attr("class", "snac-alt-text"),
24+                        xs_html_tag("details",
25+                            xs_html_tag("summary",
26+                                xs_html_text(L("Alt..."))),
27+                            xs_html_text(name))));
28             }
29         }
30     }
+1, -1
1@@ -3215,7 +3215,7 @@ int mastoapi_patch_handler(const xs_dict *req, const char *q_path,
2             const xs_str *k;
3             const xs_val *v;
4             const xs_str *field_name = NULL;
5-            xs_dict *new_fields = xs_dict_new();
6+            xs *new_fields = xs_dict_new();
7             while (xs_dict_next(args, &k, &v, &c)) {
8                 if (strcmp(k, "display_name") == 0) {
9                     if (v != NULL)