diff --git a/CHANGELOG.md b/CHANGELOG.md index 8db1a9ffbc189111312e734c436bb41e52db1038..3d74cc305aff2eb00286af5bb50396539928a491 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ * Created activity and status pages for each page independent from the outbox. This should enable searches for specific posts to work rather than simply pointing to the main user. +* In the comment section for a page if a user doesnt have a profile picture + setup it will now default to a generic avatar rather than render text. ## 1.0.1 diff --git a/api/activitypub-html/render.ts b/api/activitypub-html/render.ts index 024e92a6851c4c0f84f8891b5ab6765af6c8cb12..1bc1b74dd596d07c2d4b6b68c5fbe58cd2a3f081 100644 --- a/api/activitypub-html/render.ts +++ b/api/activitypub-html/render.ts @@ -117,7 +117,7 @@ export default async function (req: VercelRequest, res: VercelResponse) { if (typeof actor == "string") { return `<a href="${escapeHTML(actor)}" target="_parent" rel="nofollow">${escapeHTML(actor)}</a>`; } else if (actor != undefined ) { - let actor_icon_url = ""; + let actor_icon_url = "/images/missing_avatar.png"; if( actor.icon != undefined) { actor_icon_url = actor.icon.url; } @@ -135,7 +135,7 @@ export default async function (req: VercelRequest, res: VercelResponse) { if (typeof actor == "string") { return `<a href="${escapeHTML(actor)}" target="_parent" rel="nofollow">${escapeHTML(actor)}</a>`; } else if (actor != undefined ) { - let actor_icon_url = ""; + let actor_icon_url = "/images/missing_avatar.png"; if( actor.icon != undefined) { actor_icon_url = actor.icon.url; } @@ -153,7 +153,7 @@ export default async function (req: VercelRequest, res: VercelResponse) { if (typeof actor == "string") { return `<div><a href="${escapeHTML(actor)}" target="_parent" rel="nofollow">${escapeHTML(actor)}</a> wrote: <blockquote>${escapeHTML(stripHTML(object.content))}</blockquote></div>`; } else if (actor != undefined ) { - let actor_icon_url = ""; + let actor_icon_url = "/images/missing_avatar.png"; if( actor.icon != undefined) { actor_icon_url = actor.icon.url; } diff --git a/static/images/missing_avatar.png b/static/images/missing_avatar.png new file mode 100644 index 0000000000000000000000000000000000000000..34c8e45e61ce1e1ddeb6a9f69dc1979816a7286e Binary files /dev/null and b/static/images/missing_avatar.png differ