commit c356379

default  ·  2023-05-24 07:47:31 +0000 UTC
parent a73636f
Some prototype tweaks.
1 files changed,  +9, -8
M html.c
M html.c
+9, -8
 1@@ -145,7 +145,7 @@ xs_str *html_actor_icon(xs_str *os, char *actor,
 2 }
 3 
 4 
 5-d_char *html_msg_icon(snac *snac, d_char *os, char *msg)
 6+xs_str *html_msg_icon(snac *snac, xs_str *os, const xs_dict *msg)
 7 {
 8     char *actor_id;
 9     xs *actor = NULL;
10@@ -498,10 +498,10 @@ d_char *html_button(d_char *s, char *clss, char *label)
11 }
12 
13 
14-d_char *build_mentions(snac *snac, char *msg)
15+xs_str *build_mentions(snac *snac, const xs_dict *msg)
16 /* returns a string with the mentions in msg */
17 {
18-    d_char *s = xs_str_new(NULL);
19+    xs_str *s = xs_str_new(NULL);
20     char *list = xs_dict_get(msg, "tag");
21     char *v;
22 
23@@ -548,7 +548,7 @@ d_char *build_mentions(snac *snac, char *msg)
24 }
25 
26 
27-d_char *html_entry_controls(snac *snac, d_char *os, char *msg, const char *md5)
28+xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const char *md5)
29 {
30     char *id    = xs_dict_get(msg, "id");
31     char *actor = xs_dict_get(msg, "attributedTo");
32@@ -688,7 +688,7 @@ d_char *html_entry_controls(snac *snac, d_char *os, char *msg, const char *md5)
33 }
34 
35 
36-d_char *html_entry(snac *snac, d_char *os, char *msg, int local,
37+xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local,
38                    int level, const char *md5, int hide_children)
39 {
40     char *id    = xs_dict_get(msg, "id");
41@@ -1008,10 +1008,11 @@ xs_str *html_user_footer(xs_str *s)
42 }
43 
44 
45-d_char *html_timeline(snac *snac, char *list, int local, int skip, int show, int show_more)
46+xs_str *html_timeline(snac *snac, const xs_list *list, int local, int skip, int show, int show_more)
47 /* returns the HTML for the timeline */
48 {
49-    d_char *s = xs_str_new(NULL);
50+    xs_str *s = xs_str_new(NULL);
51+    xs_list *p = (xs_list *)list;
52     char *v;
53     double t = ftime();
54 
55@@ -1023,7 +1024,7 @@ d_char *html_timeline(snac *snac, char *list, int local, int skip, int show, int
56     s = xs_str_cat(s, "<a name=\"snac-posts\"></a>\n");
57     s = xs_str_cat(s, "<div class=\"snac-posts\">\n");
58 
59-    while (xs_list_iter(&list, &v)) {
60+    while (xs_list_iter(&p, &v)) {
61         xs *msg = NULL;
62 
63         if (!valid_status(timeline_get_by_md5(snac, v, &msg)))