diff options
| author | 2023-11-20 20:33:52 +0100 | |
|---|---|---|
| committer | 2023-11-20 20:33:52 +0100 | |
| commit | 73b1ef159990df6ed1627bc3e68814cf19114e96 (patch) | |
| tree | 7b980677f1531dc009a44f5a5e2fb72f9a1f8bef | |
| parent | html_actor_icon() uses xs_html. (diff) | |
| download | snac2-73b1ef159990df6ed1627bc3e68814cf19114e96.tar.gz snac2-73b1ef159990df6ed1627bc3e68814cf19114e96.tar.xz snac2-73b1ef159990df6ed1627bc3e68814cf19114e96.zip | |
html_actor_icon() returns an xs_html.
| -rw-r--r-- | html.c | 20 |
1 files changed, 12 insertions, 8 deletions
| @@ -92,7 +92,7 @@ xs_str *actor_name(xs_dict *actor) | |||
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | 94 | ||
| 95 | xs_str *html_actor_icon(xs_dict *actor, const char *date, | 95 | xs_html *html_actor_icon(xs_dict *actor, const char *date, |
| 96 | const char *udate, const char *url, int priv) | 96 | const char *udate, const char *url, int priv) |
| 97 | { | 97 | { |
| 98 | xs_html *actor_icon = xs_html_tag("p", NULL); | 98 | xs_html *actor_icon = xs_html_tag("p", NULL); |
| @@ -196,7 +196,7 @@ xs_str *html_actor_icon(xs_dict *actor, const char *date, | |||
| 196 | xs_html_text(user))); | 196 | xs_html_text(user))); |
| 197 | } | 197 | } |
| 198 | 198 | ||
| 199 | return xs_html_render(actor_icon); | 199 | return actor_icon; |
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | 202 | ||
| @@ -223,7 +223,8 @@ xs_str *html_msg_icon(xs_str *os, const xs_dict *msg) | |||
| 223 | date = xs_dict_get(msg, "published"); | 223 | date = xs_dict_get(msg, "published"); |
| 224 | udate = xs_dict_get(msg, "updated"); | 224 | udate = xs_dict_get(msg, "updated"); |
| 225 | 225 | ||
| 226 | xs *s1 = html_actor_icon(actor, date, udate, url, priv); | 226 | xs_html *actor_icon = html_actor_icon(actor, date, udate, url, priv); |
| 227 | xs *s1 = xs_html_render(actor_icon); | ||
| 227 | os = xs_str_cat(os, s1); | 228 | os = xs_str_cat(os, s1); |
| 228 | } | 229 | } |
| 229 | 230 | ||
| @@ -1706,7 +1707,9 @@ xs_str *html_people_list(snac *snac, xs_str *os, xs_list *list, const char *head | |||
| 1706 | s = xs_str_cat(s, "<div class=\"snac-post\">\n<div class=\"snac-post-header\">\n"); | 1707 | s = xs_str_cat(s, "<div class=\"snac-post\">\n<div class=\"snac-post-header\">\n"); |
| 1707 | 1708 | ||
| 1708 | { | 1709 | { |
| 1709 | xs *s1 = html_actor_icon(actor, xs_dict_get(actor, "published"), NULL, NULL, 0); | 1710 | xs_html *actor_icon = html_actor_icon(actor, |
| 1711 | xs_dict_get(actor, "published"), NULL, NULL, 0); | ||
| 1712 | xs *s1 = xs_html_render(actor_icon); | ||
| 1710 | s = xs_str_cat(s, s1, "</div>\n"); | 1713 | s = xs_str_cat(s, s1, "</div>\n"); |
| 1711 | } | 1714 | } |
| 1712 | 1715 | ||
| @@ -1910,11 +1913,12 @@ xs_str *html_notifications(snac *snac) | |||
| 1910 | s = xs_str_cat(s, s1); | 1913 | s = xs_str_cat(s, s1); |
| 1911 | 1914 | ||
| 1912 | if (strcmp(type, "Follow") == 0 || strcmp(utype, "Follow") == 0) { | 1915 | if (strcmp(type, "Follow") == 0 || strcmp(utype, "Follow") == 0) { |
| 1913 | s = xs_str_cat(s, "<div class=\"snac-post\">\n"); | 1916 | xs_html *div = xs_html_tag("div", |
| 1917 | xs_html_attr("class", "snac-post"), | ||
| 1918 | html_actor_icon(actor, NULL, NULL, NULL, 0)); | ||
| 1914 | 1919 | ||
| 1915 | xs *s1 = html_actor_icon(actor, NULL, NULL, NULL, 0); | 1920 | xs *s1 = xs_html_render(div); |
| 1916 | 1921 | s = xs_str_cat(s, s1); | |
| 1917 | s = xs_str_cat(s, s1, "</div>\n"); | ||
| 1918 | } | 1922 | } |
| 1919 | else { | 1923 | else { |
| 1920 | xs *md5 = xs_md5_hex(id, strlen(id)); | 1924 | xs *md5 = xs_md5_hex(id, strlen(id)); |