commit d704c79

grunfink  ·  2026-04-10 14:43:13 +0000 UTC
parent f5a2b96
New user toggle 'show_unlisted', to show unlisted posts in public pages and RSS feeds.
2 files changed,  +18, -3
M html.c
M rss.c
M html.c
+10, -2
 1@@ -3595,6 +3595,8 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only,
 2 
 3     int mark_shown = 0;
 4 
 5+    int show_unlisted = xs_is_true(xs_dict_get(user->config, "show_unlisted"));
 6+
 7     while (xs_list_iter(&p, &v)) {
 8         xs *msg = NULL;
 9         int status;
10@@ -3651,9 +3653,15 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only,
11         /* hide non-public posts from /instance view */
12         if (page != NULL && strcmp(page, "/instance") == 0 && scope != SCOPE_PUBLIC)
13             continue;
14+
15         /* hide non-public posts viewed from outside */
16-        if (read_only && (scope != SCOPE_PUBLIC && scope != SCOPE_UNLISTED))
17-            continue;
18+        if (read_only) {
19+            if (scope == SCOPE_MENTIONED || scope == SCOPE_FOLLOWERS)
20+                continue;
21+
22+            if (scope == SCOPE_UNLISTED && !show_unlisted)
23+                continue;
24+        }
25 
26         xs_html *entry = html_entry(user, msg, read_only, 0, v, (user && !hide_children) ? 0 : 1);
27 
M rss.c
+8, -1
 1@@ -44,6 +44,8 @@ xs_str *rss_from_timeline(snac *user, const xs_list *timeline,
 2     int cnt = 0;
 3     const char *v;
 4 
 5+    int show_unlisted = xs_is_true(xs_dict_get(user->config, "show_unlisted"));
 6+
 7     xs_list_foreach(timeline, v) {
 8         xs *msg = NULL;
 9 
10@@ -66,7 +68,12 @@ xs_str *rss_from_timeline(snac *user, const xs_list *timeline,
11         if (!id || !content || !published)
12             continue;
13 
14-        if (!is_msg_public(msg))
15+        int scope = get_msg_visibility(msg);
16+
17+        if (scope == SCOPE_MENTIONED || scope == SCOPE_FOLLOWERS)
18+            continue;
19+
20+        if (scope == SCOPE_UNLISTED && !show_unlisted)
21             continue;
22 
23         /* create a title with the first line of the content */