models/user: return server actor for APServer user ID

This commit is contained in:
famfo 2025-02-23 02:58:00 +01:00
parent c5e5fcc192
commit a03133e728
No known key found for this signature in database

View file

@ -313,6 +313,10 @@ func (u *User) HTMLURL() string {
// APActorID returns the IRI to the api endpoint of the user
func (u *User) APActorID() string {
if u.ID == APActorUserID {
return fmt.Sprintf("%vapi/v1/activitypub/actor", setting.AppURL)
}
return fmt.Sprintf("%vapi/v1/activitypub/user-id/%v", setting.AppURL, url.PathEscape(fmt.Sprintf("%v", u.ID)))
}