diff options
author | FChannel <> | 2021-07-15 15:24:39 -0700 |
---|---|---|
committer | FChannel <> | 2021-07-15 15:24:39 -0700 |
commit | a13a0d96f3808c17d9c50df1af400b73445f64ac (patch) | |
tree | 277e68f258ee7007571fdec62b8c19c3e521e14f /main.go | |
parent | e97c3e9d2d1bedf63a7d341eb199c9500bcd8cd9 (diff) |
when using /g/followers or /g/following also follow the board g
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -484,8 +484,14 @@ func main() { if following.MatchString(follow) { followingActor := FingerActor(follow) col := GetActorCollection(followingActor.Following) + + var nObj ObjectBase + nObj.Id = followingActor.Id + + col.Items = append(col.Items, nObj) + for _, e := range col.Items { - if !IsAlreadyFollowing(db, actorId, e.Id) && e.Id != Domain { + if !IsAlreadyFollowing(db, actorId, e.Id) && e.Id != Domain && e.Id != actorId { followActivity := MakeFollowActivity(db, actorId, e.Id) if FingerActor(e.Id).Id != "" { @@ -498,8 +504,14 @@ func main() { } else if followers.MatchString(follow){ followersActor := FingerActor(follow) col := GetActorCollection(followersActor.Followers) + + var nObj ObjectBase + nObj.Id = followersActor.Id + + col.Items = append(col.Items, nObj) + for _, e := range col.Items { - if !IsAlreadyFollowing(db, actorId, e.Id) && e.Id != Domain { + if !IsAlreadyFollowing(db, actorId, e.Id) && e.Id != Domain && e.Id != actorId { followActivity := MakeFollowActivity(db, actorId, e.Id) if FingerActor(e.Id).Id != "" { MakeActivityRequestOutbox(db, followActivity) |