Skip to content

Commit 01e239e

Browse files
authored
Merge pull request writefreely#1373 from writefreely/fix-ghost-follow
Fix ActivityPub following from Ghost
2 parents 79ab0a3 + c249abd commit 01e239e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

activitypub.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,17 @@ func handleFetchCollectionInbox(app *App, w http.ResponseWriter, r *http.Request
436436
a.AppendObject(f.Raw())
437437
_, to = f.GetActor(0)
438438
obj := f.Raw().GetObjectIRI(0)
439+
if obj == nil {
440+
if debugging {
441+
log.Error("GetObjectIRI on Follow for actor is empty; trying object")
442+
}
443+
ao := f.Raw().GetObject(0)
444+
if ao == nil {
445+
log.Error("Fell back to GetObject and none parsed, so no actor ID! Follow request probably FAILED!")
446+
} else {
447+
obj = ao.GetId()
448+
}
449+
}
439450
a.AppendActor(obj)
440451

441452
// First get actor information

0 commit comments

Comments
 (0)