Fix UnfollowUser addressing

This commit is contained in:
Anthony Wang 2022-11-12 05:35:30 +00:00
parent ca502244a0
commit 20e8c64317
No known key found for this signature in database
GPG Key ID: 42A5B952E6DD8D38
1 changed files with 2 additions and 1 deletions

View File

@ -68,8 +68,9 @@ func UnfollowUser(userID, followID int64) (err error) {
object := ap.PersonNew(ap.IRI(followUser.LoginName))
follow := ap.FollowNew("", object)
follow.Actor = ap.PersonNew(ap.IRI(setting.AppURL + "api/v1/activitypub/user/" + actorUser.Name))
follow.To = ap.ItemCollection{ap.Item(ap.IRI(followUser.LoginName + "/inbox"))}
unfollow := ap.UndoNew("", follow)
unfollow.Type = ap.UndoType
unfollow.To = ap.ItemCollection{ap.Item(ap.IRI(followUser.LoginName + "/inbox"))}
err = activitypub.Send(actorUser, unfollow)
if err != nil {
return err