summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-10-02 18:16:58 +0200
committerdefault <nobody@localhost>2022-10-02 18:16:58 +0200
commitf82124a705d9c5350b92fba6a03c556c1fd5b2b0 (patch)
tree0382d0058097f25340de8077c5498a46b05736bd /html.c
parent20fd70c01145e6be40edf231781497a2b5ec404f (diff)
The history is shown at the bottom of the local timeline.
Diffstat (limited to 'html.c')
-rw-r--r--html.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/html.c b/html.c
index ad867af..f36bcfb 100644
--- a/html.c
+++ b/html.c
@@ -483,6 +483,10 @@ d_char *html_entry(snac *snac, d_char *os, char *msg, xs_set *seen, int local, i
xs *actor_o = NULL;
char *actor;
+ /* do not show non-public messages in the public timeline */
+ if (local && !is_msg_public(snac, msg))
+ return os;
+
/* return if already seen */
if (xs_set_add(seen, id) == 0)
return os;
@@ -720,6 +724,31 @@ d_char *html_timeline(snac *snac, char *list, int local)
s = xs_str_cat(s, "</div>\n");
+ if (local) {
+ xs *s1 = xs_fmt(
+ "<div class=\"snac-history\">\n"
+ "<p class=\"snac-history-title\">%s</p><ul>\n",
+ L("History")
+ );
+
+ s = xs_str_cat(s, s1);
+
+ xs *list = history_list(snac);
+ char *p, *v;
+
+ p = list;
+ while (xs_list_iter(&p, &v)) {
+ xs *fn = xs_replace(v, ".html", "");
+ xs *s1 = xs_fmt(
+ "<li><a href=\"%s/h/%s\">%s</li>\n",
+ snac->actor, v, fn);
+
+ s = xs_str_cat(s, s1);
+ }
+
+ s = xs_str_cat(s, "</ul></div>\n");
+ }
+
s = html_user_footer(snac, s);
{