Show the avatar in the nav menu.

This commit is contained in:
default 2023-02-20 11:09:39 +01:00
parent 188d224e35
commit 9d02e70a2f

14
html.c
View file

@ -210,6 +210,20 @@ d_char *html_user_header(snac *snac, d_char *s, int local)
/* top nav */
s = xs_str_cat(s, "<nav class=\"snac-top-nav\">");
{
xs *s1;
xs *avatar = xs_dup(xs_dict_get(snac->config, "avatar"));
if (avatar == NULL || *avatar == '\0') {
xs_free(avatar);
avatar = xs_fmt("data:image/png;base64, %s", default_avatar_base64());
}
s1 = xs_fmt("<img src=\"%s\" class=\"snac-avatar\" alt=\"\"/>&nbsp;", avatar);
s = xs_str_cat(s, s1);
}
{
xs *s1;