Return a Person instead of a Service
This commit is contained in:
parent
d8ac0284cb
commit
329b6cc629
1 changed files with 21 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
import { createFederation, Service, Application, Image } from "@fedify/fedify"
|
import { createFederation, Person, Application, Image, PropertyValue } from "@fedify/fedify"
|
||||||
import { kv } from "./redis.ts"
|
import { kv } from "./redis.ts"
|
||||||
import { getLogger } from "https://jsr.io/@logtape/logtape/0.6.3/logtape/logger.ts"
|
import { getLogger } from "https://jsr.io/@logtape/logtape/0.6.3/logtape/logger.ts"
|
||||||
import { doQueryPlayer } from "./graphql/stratz.ts"
|
import { doQueryPlayer } from "./graphql/stratz.ts"
|
||||||
|
@ -45,7 +45,7 @@ async function actorDispatcher(ctx: any, handle: string) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Service({
|
return new Person({
|
||||||
id,
|
id,
|
||||||
preferredUsername: id.href,
|
preferredUsername: id.href,
|
||||||
// Akkoma expects URL to be equal to ID
|
// Akkoma expects URL to be equal to ID
|
||||||
|
@ -59,7 +59,25 @@ async function actorDispatcher(ctx: any, handle: string) {
|
||||||
icon: new Image({
|
icon: new Image({
|
||||||
url: new URL(player.avatar),
|
url: new URL(player.avatar),
|
||||||
mediaType: "image/jpeg"
|
mediaType: "image/jpeg"
|
||||||
})
|
}),
|
||||||
|
attachments: [
|
||||||
|
new PropertyValue({
|
||||||
|
name: "Steam",
|
||||||
|
value: `<a href="https://steamcommunity.com/profiles/[U:1:${player.id}]">https://steamcommunity.com/profiles/[U:1:${player.id}]</a>`,
|
||||||
|
}),
|
||||||
|
new PropertyValue({
|
||||||
|
name: "Dota profile",
|
||||||
|
value: `<a href="https://stratz.com/players/${player.id}">https://stratz.com/players/${player.id}</a>`,
|
||||||
|
}),
|
||||||
|
new PropertyValue({
|
||||||
|
name: "OpenDota",
|
||||||
|
value: `<a href="https://www.opendota.com/players/${player.id}">https://www.opendota.com/players/${player.id}</a>`,
|
||||||
|
}),
|
||||||
|
new PropertyValue({
|
||||||
|
name: "DOTABUFF",
|
||||||
|
value: `<a href="https://www.dotabuff.com/players/${player.id}">https://www.dotabuff.com/players/${player.id}</a>`,
|
||||||
|
}),
|
||||||
|
]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue