mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
feat: support actor URL as a way to add federated event source
This commit is contained in:
parent
6a102a95f3
commit
7e19f7d91c
1 changed files with 11 additions and 11 deletions
|
@ -178,19 +178,19 @@ const instancesController = {
|
|||
|
||||
let actor
|
||||
// should we try to use URL as actor? to review
|
||||
// try {
|
||||
// log.debug('[FEDI] Trying to use %s as actor', url)
|
||||
// actor = await getActor(url, instance)
|
||||
// log.debug('[FEDI] Actor %s', actor)
|
||||
// await actor.update({ trusted: true })
|
||||
// await followActor(actor)
|
||||
// return res.json(actor)
|
||||
// } catch (e) {
|
||||
// log.debug('[FEDI] %s is probably not an actor: %s', url, e)
|
||||
// }
|
||||
try {
|
||||
log.debug('[FEDI] Trying to use %s as actor', url)
|
||||
actor = await getActor(url, instance)
|
||||
log.debug('[FEDI] Actor %s', actor)
|
||||
await actor.update({ trusted: true })
|
||||
await followActor(actor)
|
||||
return res.json(actor)
|
||||
} catch (e) {
|
||||
log.debug('[FEDI] %s is probably not an actor: %s', url, e)
|
||||
}
|
||||
|
||||
// ok this wasn't an actor, let's use the applicationActor if exists
|
||||
if (instance?.applicationActor) {
|
||||
if (!actor && instance?.applicationActor) {
|
||||
log.debug('[FEDI] This node supports FEP-2677 and applicationActor is: %s', instance.applicationActor)
|
||||
actor = await getActor(instance.applicationActor, instance, true)
|
||||
log.debug('[FEDI] Actor %s', actor)
|
||||
|
|
Loading…
Reference in a new issue