From 6b597ffdb44a5fce7a7da6b5613f0607de483f99 Mon Sep 17 00:00:00 2001 From: default Date: Sat, 13 May 2023 09:35:43 +0200 Subject: Only show the bio in the top of the page for public pages. --- html.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/html.c b/html.c index 1227cfe..861ac8b 100644 --- a/html.c +++ b/html.c @@ -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 = "
\n" "

%s

\n" - "

@%s@%s

\n" - "
%s
\n" - "
\n"; - - bio = not_really_markdown(xs_dict_get(snac->config, "bio")); + "

@%s@%s

\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("
%s
\n", bio); + + s = xs_str_cat(s, s1); + } + + s = xs_str_cat(s, "\n"); } return s; -- cgit v1.2.3