fixes 404 for own private profile

This commit is contained in:
Christian Beutel
2025-06-24 15:15:35 +02:00
parent 8e3eea6216
commit cb4f4f8125
2 changed files with 15 additions and 6 deletions

View File

@@ -122,6 +122,7 @@ func assembleActor(dbActor *core.Record, app core.App, includeFollows bool) (*co
return nil, fmt.Errorf("ORIGIN environment variable not set")
}
private := false
if dbActor.GetBool("isLocal") {
user, err := app.FindRecordById("users", dbActor.GetString("user"))
if err != nil {
@@ -153,11 +154,7 @@ func assembleActor(dbActor *core.Record, app core.App, includeFollows bool) (*co
result := make(map[string]interface{})
json.Unmarshal([]byte(privacy), &result)
private := result["account"] == "private"
if private {
return nil, fmt.Errorf("profile is private")
}
private = result["account"] == "private"
} else {
@@ -219,6 +216,10 @@ func assembleActor(dbActor *core.Record, app core.App, includeFollows bool) (*co
return nil, err
}
if private {
return dbActor, fmt.Errorf("profile is private")
}
return dbActor, nil
}