Skip to content

Commit

Permalink
Used Image instead of URL for Actors icon
Browse files Browse the repository at this point in the history
ref https://mitra.social/post/01908de4-a9e1-41ef-eaef-b30f3170e75b

Fedify expects an `icon` to be an instance of `Image`
  • Loading branch information
dahlia authored Jul 8, 2024
1 parent c82715d commit 3e5908e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/dispatchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
Article,
Accept,
Follow,
Image,
Person,
RequestContext,
lookupObject,
Expand Down Expand Up @@ -37,7 +38,7 @@ async function getUserData(ctx: RequestContext<ContextData>, handle: string) {
name: existing.name,
summary: existing.summary,
preferredUsername: existing.preferredUsername,
icon: new URL(existing.icon),
icon: new Image({ url: new URL(existing.icon) }),
inbox: new URL(existing.inbox),
outbox: new URL(existing.outbox),
following: new URL(existing.following),
Expand All @@ -53,7 +54,7 @@ async function getUserData(ctx: RequestContext<ContextData>, handle: string) {
name: `Local Ghost site`,
summary: 'This is a summary',
preferredUsername: handle,
icon: new URL('https://ghost.org/favicon.ico'),
icon: new Image({ url: new URL('https://ghost.org/favicon.ico') }),
inbox: ctx.getInboxUri(handle),
outbox: ctx.getOutboxUri(handle),
following: ctx.getFollowingUri(handle),
Expand All @@ -68,7 +69,7 @@ async function getUserData(ctx: RequestContext<ContextData>, handle: string) {
name: data.name,
summary: data.summary,
preferredUsername: data.preferredUsername,
icon: data.icon.href,
icon: data.icon.url!.href as string,
inbox: data.inbox.href,
outbox: data.outbox.href,
following: data.following.href,
Expand Down

0 comments on commit 3e5908e

Please sign in to comment.