diff options
author | default <nobody@localhost> | 2023-05-13 09:35:43 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-05-13 09:35:43 +0200 |
commit | 6b597ffdb44a5fce7a7da6b5613f0607de483f99 (patch) | |
tree | 6a8a581f1212d130716a219c5cb78af7e43c026a | |
parent | ac39a3b796ab76e22903925ce4abcfd60de29b17 (diff) |
Only show the bio in the top of the page for public pages.
-rw-r--r-- | html.c | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -224,7 +224,7 @@ d_char *html_user_header(snac *snac, d_char *s, int local) xs *s_bio = xs_dup(xs_dict_get(snac->config, "bio")); int n; - /* sorten a bio */ + /* shorten the bio */ for (n = 0; s_bio[n] && s_bio[n] != '&' && s_bio[n] != '\r' && s_bio[n] != '\n' && n < 128; n++); s_bio[n] = '\0'; @@ -310,23 +310,26 @@ d_char *html_user_header(snac *snac, d_char *s, int local) /* user info */ { - xs *bio = NULL; char *_tmpl = "<div class=\"h-card snac-top-user\">\n" "<p class=\"p-name snac-top-user-name\">%s</p>\n" - "<p class=\"snac-top-user-id\">@%s@%s</p>\n" - "<div class=\"p-note snac-top-user-bio\">%s</div>\n" - "</div>\n"; - - bio = not_really_markdown(xs_dict_get(snac->config, "bio")); + "<p class=\"snac-top-user-id\">@%s@%s</p>\n"; xs *s1 = xs_fmt(_tmpl, xs_dict_get(snac->config, "name"), - xs_dict_get(snac->config, "uid"), xs_dict_get(srv_config, "host"), - bio + xs_dict_get(snac->config, "uid"), xs_dict_get(srv_config, "host") ); s = xs_str_cat(s, s1); + + if (local) { + xs *bio = not_really_markdown(xs_dict_get(snac->config, "bio")); + xs *s1 = xs_fmt("<div class=\"p-note snac-top-user-bio\">%s</div>\n", bio); + + s = xs_str_cat(s, s1); + } + + s = xs_str_cat(s, "</div>\n"); } return s; |