From a2e08688d5e7fbf1974758c4561d88bccc402385 Mon Sep 17 00:00:00 2001 From: default Date: Thu, 30 May 2024 10:49:32 +0200 Subject: [PATCH 1/5] Fixed minor leak. --- mastoapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mastoapi.c b/mastoapi.c index c1f70b9..cc4c274 100644 --- a/mastoapi.c +++ b/mastoapi.c @@ -3185,7 +3185,7 @@ int mastoapi_patch_handler(const xs_dict *req, const char *q_path, const xs_str *k; const xs_val *v; const xs_str *field_name = NULL; - xs_dict *new_fields = xs_dict_new(); + xs *new_fields = xs_dict_new(); while (xs_dict_next(args, &k, &v, &c)) { if (strcmp(k, "display_name") == 0) { if (v != NULL) From a2ee9d802ab0dbb7c7144ea77b8d1bdc86a45f1c Mon Sep 17 00:00:00 2001 From: default Date: Thu, 30 May 2024 10:49:41 +0200 Subject: [PATCH 2/5] Updated RELEASE_NOTES. --- RELEASE_NOTES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 7573246..f48e82d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -6,6 +6,10 @@ Markdown-style links are now supported. The avatar and/or the header images can now be deleted (contributed by louis77). +Code cleaning: HTTP status codes use names instead of hardcoded integers (contributed by louis77). + +Mastodon API: some fixes for Mona and Tokodon apps, user credentials can now be edited from apps (contributed by louis77). + The webfinger content-type response header is now RFC-compliant (contributed by steve-bate). ## 2.53 From a5ec96a6da5437cad88487205d62a95f27614bd7 Mon Sep 17 00:00:00 2001 From: default Date: Thu, 30 May 2024 16:12:08 +0200 Subject: [PATCH 3/5] Added an "Alt..." details just below attachments with them. The alt text is still also generated as 'alt' and 'name' attributes, but this is more usable from phones and tablets. --- activitypub.c | 2 +- html.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/activitypub.c b/activitypub.c index 4247078..212dd2f 100644 --- a/activitypub.c +++ b/activitypub.c @@ -239,7 +239,7 @@ xs_list *get_attachments(const xs_dict *msg) if (xs_is_null(name)) name = xs_dict_get(msg, "name"); if (xs_is_null(name)) - name = L("No description"); + name = ""; xs *d = xs_dict_new(); d = xs_dict_append(d, "type", type); diff --git a/html.c b/html.c index bacee5b..b50d69e 100644 --- a/html.c +++ b/html.c @@ -1891,6 +1891,9 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, xs_html_tag("a", xs_html_attr("href", href), xs_html_text(href)))); + + /* do not generate an Alt... */ + name = NULL; } else { xs_html_add(content_attachments, @@ -1900,6 +1903,18 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, xs_html_text(L("Attachment")), xs_html_text(": "), xs_html_text(href)))); + + /* do not generate an Alt... */ + name = NULL; + } + + if (name != NULL && *name) { + xs_html_add(content_attachments, + xs_html_tag("p", + xs_html_tag("details", + xs_html_tag("summary", + xs_html_text(L("Alt..."))), + xs_html_text(name)))); } } } From b8633c7c59637f3ca90f44d67088d61b2e232917 Mon Sep 17 00:00:00 2001 From: default Date: Thu, 30 May 2024 16:14:56 +0200 Subject: [PATCH 4/5] Added a class to the new "Alt...". --- html.c | 1 + 1 file changed, 1 insertion(+) diff --git a/html.c b/html.c index b50d69e..c3a2efe 100644 --- a/html.c +++ b/html.c @@ -1911,6 +1911,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, if (name != NULL && *name) { xs_html_add(content_attachments, xs_html_tag("p", + xs_html_attr("class", "snac-alt-text"), xs_html_tag("details", xs_html_tag("summary", xs_html_text(L("Alt..."))), From eed9324cb0ea216bfb649a47bbfcc521824a2836 Mon Sep 17 00:00:00 2001 From: default Date: Thu, 30 May 2024 17:30:06 +0200 Subject: [PATCH 5/5] Updated RELEASE_NOTES. --- RELEASE_NOTES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index f48e82d..b0d37f4 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -4,6 +4,8 @@ Markdown-style links are now supported. +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). + The avatar and/or the header images can now be deleted (contributed by louis77). Code cleaning: HTTP status codes use names instead of hardcoded integers (contributed by louis77).