From: Art Cancro Date: Thu, 29 Jun 2023 22:03:34 +0000 (-0400) Subject: Generic user icon instead of 404 when avatar not found. X-Git-Tag: v981~61 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=e59a9e4bed29f60616b5be722d4af2ca816eb44b;p=citadel.git Generic user icon instead of 404 when avatar not found. Doing a 404 and then substituting a font-awesome icon makes it 404 over and over and over again. This is better. --- diff --git a/webcit-ng/server/user_functions.c b/webcit-ng/server/user_functions.c index 0b4548ec3..de4233dfb 100644 --- a/webcit-ng/server/user_functions.c +++ b/webcit-ng/server/user_functions.c @@ -37,7 +37,11 @@ void fetch_user_photo(struct http_transaction *h, struct ctdlsession *c, char *u return; } - do_404(h); + // The user has no avatar on file. Redirect to a generic avatar. + http_redirect(h, "/ctdl/s/images/generic-user-icon-32px.png"); + + // Sending a 404 makes the browser request the same thing over and over again. + // do_404(h); } diff --git a/webcit-ng/static/images/generic-user-icon-32px.png b/webcit-ng/static/images/generic-user-icon-32px.png new file mode 100644 index 000000000..47149221a Binary files /dev/null and b/webcit-ng/static/images/generic-user-icon-32px.png differ