From d94cbd3375df4cd01d068f56da1c6e4b0acd693c Mon Sep 17 00:00:00 2001 From: FChannel <=> Date: Mon, 25 Jan 2021 14:14:27 -0800 Subject: removed duplicated To fields --- main.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'main.go') 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 -- cgit v1.2.3