aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorFChannel <=>2021-01-25 14:14:27 -0800
committerFChannel <=>2021-01-25 14:14:27 -0800
commitd94cbd3375df4cd01d068f56da1c6e4b0acd693c (patch)
tree363cc205bfd350c205f26cb23c8a1c05df6df897 /main.go
parentaa76455a3dfd4504697e1b3fdb33e0aeb01db4d7 (diff)
removed duplicated To fields
Diffstat (limited to 'main.go')
-rw-r--r--main.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/main.go b/main.go
index 4976fcf..55c97cd 100644
--- a/main.go
+++ b/main.go
@@ -1029,7 +1029,16 @@ func AddFollowersToActivity(db *sql.DB, activity Activity) Activity{
followers := GetActorFollowDB(db, activity.Actor.Id)
for _, e := range followers {
- activity.To = append(activity.To, e.Id)
+ var alreadyTo = false
+ for _, k := range activity.To {
+ if k == e.Id {
+ alreadyTo = true
+ }
+ }
+
+ if !alreadyTo {
+ activity.To = append(activity.To, e.Id)
+ }
}
return activity