From 20e8c64317e232865107589a5d58ee9a14313805 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Sat, 12 Nov 2022 05:35:30 +0000 Subject: [PATCH] Fix UnfollowUser addressing --- services/user/activitypub.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/user/activitypub.go b/services/user/activitypub.go index b191db8ab9..8b80a42bf7 100644 --- a/services/user/activitypub.go +++ b/services/user/activitypub.go @@ -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