commit 54fe489

default  ·  2025-02-08 04:38:10 +0000 UTC
parent 1787102
Show links to followed hashtags just below the list of lists.
1 files changed,  +23, -0
M html.c
M html.c
+23, -0
 1@@ -2706,6 +2706,29 @@ xs_str *html_timeline(snac *user, const xs_list *list, int read_only,
 2                         xs_html_attr("title", L("Post drafts")),
 3                         xs_html_text("drafts"))));
 4         }
 5+
 6+        /* the list of followed hashtags */
 7+        const char *followed_hashtags = xs_dict_get(user->config, "followed_hashtags");
 8+
 9+        if (xs_is_list(followed_hashtags) && xs_list_len(followed_hashtags)) {
10+            xs_html *loht = xs_html_tag("ul",
11+                xs_html_attr("class", "snac-list-of-lists"));
12+            xs_html_add(body, loht);
13+
14+            const char *ht;
15+
16+            xs_list_foreach(followed_hashtags, ht) {
17+                xs *url = xs_fmt("%s/admin?q=%s", user->actor, ht);
18+                url = xs_replace_i(url, "#", "%23");
19+
20+                xs_html_add(loht,
21+                    xs_html_tag("li",
22+                        xs_html_tag("a",
23+                            xs_html_attr("href", url),
24+                            xs_html_attr("class", "snac-list-link"),
25+                            xs_html_text(ht))));
26+            }
27+        }
28     }
29 
30     xs_html_add(body,