summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-09-28 10:40:35 +0200
committerdefault <nobody@localhost>2022-09-28 10:40:35 +0200
commit69bc24a4bf188b0d504cfaa1350d9381ed45eb89 (patch)
treee9026963b41122bfbfc9a326a814a9f42cf4b1da /html.c
parent5afb60f173dd1a266d023bb6568ca127ab6ea4b1 (diff)
More HTML work.
Diffstat (limited to 'html.c')
-rw-r--r--html.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/html.c b/html.c
index 1e7788d..8160b4e 100644
--- a/html.c
+++ b/html.c
@@ -370,16 +370,37 @@ d_char *html_top_controls(snac *snac, d_char *s)
}
+d_char *html_entry(snac *snac, d_char *s, char *msg, xs_set *seen, int level)
+{
+ char *id = xs_dict_get(msg, "id");
+
+ /* return if already seen */
+ if (xs_set_add(seen, id) == 0)
+ return s;
+
+ return s;
+}
+
+
d_char *html_timeline(snac *snac, char *list, int local)
/* returns the HTML for the timeline */
{
d_char *s = xs_str_new(NULL);
+ xs_set *seen = xs_set_new(4096);
+ char *v;
s = html_user_header(snac, s, local);
if (!local)
s = html_top_controls(snac, s);
+ while (xs_list_iter(&list, &v)) {
+ xs *msg = timeline_get(snac, v);
+
+ s = html_entry(snac, s, msg, seen, 0);
+ }
+
+#if 0
s = xs_str_cat(s, "<h1>HI</h1>\n");
s = xs_str_cat(s, xs_fmt("len() == %d\n", xs_list_len(list)));
@@ -392,6 +413,9 @@ d_char *html_timeline(snac *snac, char *list, int local)
}
s = xs_str_cat(s, "</html>\n");
+#endif
+
+ xs_set_free(seen);
return s;
}