aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaltux <1medinnz@duck.com>2025-12-26 15:15:14 -0300
committerDaltux <1medinnz@duck.com>2025-12-26 15:15:14 -0300
commitf5f03f4634b534b025ea11d570bf469f9d1667d0 (patch)
treef8b037be59d46558949dda1368322747a21f238d
parent9d08379c8aaf1b03de7e6e0ff322b869ed9000db (diff)
parent53043a6785e8880e8ec1b71d6ad2b13096347a44 (diff)
Merge remote-tracking branch 'origin/master' into pt_BR-6
-rw-r--r--RELEASE_NOTES.md2
-rw-r--r--mastoapi.c82
-rw-r--r--po/de_DE.po8
3 files changed, 48 insertions, 44 deletions
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 9d41588..d28b125 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -4,7 +4,7 @@
Added emoji reactions (contributed by violette).
-Mastodon API: Fix for some client notifications (contributed by violette).
+Mastodon API: Fix for some client notifications (contributed by violette), fix for a status visibility error (contributed by fruye).
If the query variable `terse` of a public post page is set to anything, no header is shown.
diff --git a/mastoapi.c b/mastoapi.c
index d38e902..6a12ced 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -1985,60 +1985,64 @@ 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 */
- const char *limit_s = xs_dict_get(args, "limit");
- const char *o_max_id = xs_dict_get(args, "max_id");
- int limit = limit_s ? atoi(limit_s) : 20;
- xs *max_id = o_max_id ? xs_tolower_i(xs_dup(o_max_id)) : NULL;
+ if (logged_in || xs_type(xs_dict_get(snac2.config, "private")) == XSTYPE_FALSE) {
+ /* the public list of posts of a user */
+ const char *limit_s = xs_dict_get(args, "limit");
+ const char *o_max_id = xs_dict_get(args, "max_id");
+ int limit = limit_s ? atoi(limit_s) : 20;
+ xs *max_id = o_max_id ? xs_tolower_i(xs_dup(o_max_id)) : NULL;
- srv_debug(1, xs_fmt("account statuses: max_id=%s limit=%d", max_id ? max_id : "(null)", limit));
+ srv_debug(1, xs_fmt("account statuses: max_id=%s limit=%d", max_id ? max_id : "(null)", limit));
- xs *timeline = timeline_simple_list(&snac2, "public", 0, 256, NULL);
- xs_list *p = timeline;
- const xs_str *v;
- xs_set seen;
- int cnt = 0;
- int skip_until_max = max_id != NULL;
+ xs *timeline = timeline_simple_list(&snac2, "public", 0, 256, NULL);
+ xs_list *p = timeline;
+ const xs_str *v;
+ xs_set seen;
+ int cnt = 0;
+ int skip_until_max = max_id != NULL;
- out = xs_list_new();
- xs_set_init(&seen);
+ out = xs_list_new();
+ xs_set_init(&seen);
- while (xs_list_iter(&p, &v) && cnt < limit) {
- xs *msg = NULL;
+ while (xs_list_iter(&p, &v) && cnt < limit) {
+ xs *msg = NULL;
- if (valid_status(timeline_get_by_md5(&snac2, v, &msg))) {
- const char *msg_id = xs_dict_get(msg, "id");
+ if (valid_status(timeline_get_by_md5(&snac2, v, &msg))) {
+ const char *msg_id = xs_dict_get(msg, "id");
- /* add only posts by the author */
- if (!xs_is_null(msg_id) &&
- strcmp(xs_dict_get(msg, "type"), "Note") == 0 &&
- is_msg_mine(&snac2, xs_dict_get(msg, "id")) && is_msg_public(msg)) {
+ /* add only posts by the author */
+ if (!xs_is_null(msg_id) &&
+ strcmp(xs_dict_get(msg, "type"), "Note") == 0 &&
+ is_msg_mine(&snac2, xs_dict_get(msg, "id")) && is_msg_public(msg)) {
- /* if max_id is set, skip entries until we find it */
- if (skip_until_max) {
- xs *mid = mastoapi_id(msg);
- if (strcmp(mid, max_id) == 0) {
- skip_until_max = 0;
- srv_debug(2, xs_fmt("account statuses: found max_id, starting from next post"));
+ /* if max_id is set, skip entries until we find it */
+ if (skip_until_max) {
+ xs *mid = mastoapi_id(msg);
+ if (strcmp(mid, max_id) == 0) {
+ skip_until_max = 0;
+ srv_debug(2, xs_fmt("account statuses: found max_id, starting from next post"));
+ }
+ continue;
}
- continue;
- }
- /* deduplicate by message id */
- if (xs_set_add(&seen, msg_id) == 1) {
- xs *st = mastoapi_status(&snac2, msg);
+ /* deduplicate by message id */
+ if (xs_set_add(&seen, msg_id) == 1) {
+ xs *st = mastoapi_status(&snac2, msg);
- if (st) {
- out = xs_list_append(out, st);
- cnt++;
+ if (st) {
+ out = xs_list_append(out, st);
+ cnt++;
+ }
}
}
}
}
- }
- srv_debug(1, xs_fmt("account statuses: returning %d posts (requested %d)", cnt, limit));
- xs_set_free(&seen);
+ srv_debug(1, xs_fmt("account statuses: returning %d posts (requested %d)", cnt, limit));
+ xs_set_free(&seen);
+ }
+ else
+ status = HTTP_STATUS_UNAUTHORIZED;
}
else
if (strcmp(opt, "featured_tags") == 0) {
diff --git a/po/de_DE.po b/po/de_DE.po
index 6257354..2db7ca3 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -798,16 +798,16 @@ msgstr "Direktnachricht"
#: html.c:488 html.c:2534 html.c:2559 html.c:5177
msgid "EmojiUnreact"
-msgstr ""
+msgstr "Emoji-Reaktion löschen"
#: html.c:488 html.c:1440 html.c:2534 html.c:2559 html.c:5188
msgid "EmojiReact"
-msgstr ""
+msgstr "Emoji-Reaktion"
#: html.c:2115
msgid "Emoji react..."
-msgstr ""
+msgstr "Emoji-Reaktion..."
#: html.c:2609
msgid "Emoji reactions: "
-msgstr ""
+msgstr "Emoji-Reaktionen:"