commit 9d02e70a2fd05b48abde342ea76e82ad7a30f3f1
parent 188d224e352f4b6cf3e38b4c0a970b87da7a260f
Author: default <nobody@localhost>
Date:   Mon, 20 Feb 2023 11:09:39 +0100
Show the avatar in the nav menu.
Diffstat:
1 file changed, 14 insertions(+), 0 deletions(-)
diff --git a/html.c b/html.c
@@ -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(