diff options
author | default <nobody@localhost> | 2023-02-20 11:09:39 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2023-02-20 11:09:39 +0100 |
commit | 9d02e70a2fd05b48abde342ea76e82ad7a30f3f1 (patch) | |
tree | e1cd71a4353b0900199e2f8a87cf17b158739e42 /html.c | |
parent | 188d224e352f4b6cf3e38b4c0a970b87da7a260f (diff) |
Show the avatar in the nav menu.
Diffstat (limited to 'html.c')
-rw-r--r-- | html.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -212,6 +212,20 @@ d_char *html_user_header(snac *snac, d_char *s, int local) { 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=\"\"/> ", avatar); + + s = xs_str_cat(s, s1); + } + + { + xs *s1; if (local) s1 = xs_fmt( |