diff options
author | FChannel <=> | 2021-01-25 14:14:27 -0800 |
---|---|---|
committer | FChannel <=> | 2021-01-25 14:14:27 -0800 |
commit | d94cbd3375df4cd01d068f56da1c6e4b0acd693c (patch) | |
tree | 363cc205bfd350c205f26cb23c8a1c05df6df897 /main.go | |
parent | aa76455a3dfd4504697e1b3fdb33e0aeb01db4d7 (diff) |
removed duplicated To fields
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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 |