aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorFChannel <=>2021-01-25 19:36:13 -0800
committerFChannel <=>2021-01-25 19:36:13 -0800
commit4fed11e91912f8c50808d281c5ed8eaf62fae956 (patch)
tree83f145c591ad94c007efbffc8dc90034036809f4 /main.go
parent613b454b1208db3ce30865901f60f365513829d9 (diff)
activity To logic for followers to send to
Diffstat (limited to 'main.go')
-rw-r--r--main.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/main.go b/main.go
index 4a5ec35..7c31bbb 100644
--- a/main.go
+++ b/main.go
@@ -1031,13 +1031,22 @@ func AddFollowersToActivity(db *sql.DB, activity Activity) Activity{
var nActivity Activity
for _, e := range followers {
var tempActivity Activity
- actor := GetActor(e.Id)
- aFollowers := GetActorCollection(actor.Followers)
+ aFollowers := GetActorCollection(e.Id + "/followers")
for _, k := range aFollowers.Items {
- tempActivity.To = append(tempActivity.To, k.Id)
+ bFollowers := GetActorCollection(k.Id + "/followers")
+ var isFollowingActor = false
+ for _, n := range bFollowers.Items {
+ if n.Id == activity.Actor.Id {
+ isFollowingActor = true
+ }
+ }
+
+ if isFollowingActor {
+ tempActivity.To = append(tempActivity.To, k.Id)
+ }
}
+
tempActivity.To = append(tempActivity.To, e.Id)
-
for _, k := range tempActivity.To {
var alreadyTo = false
for _, n := range nActivity.To {