Deduplicate incoming followers
This commit is contained in:
parent
e7dcbdc6a4
commit
e0c8f8e142
|
@ -42,7 +42,8 @@ defmodule Clacks.Inbox do
|
|||
|
||||
store_activity(activity)
|
||||
|
||||
changeset = Actor.changeset(followed, %{followers: [follower_id | followed.followers]})
|
||||
new_followers = [follower_id | followed.followers] |> Enum.uniq()
|
||||
changeset = Actor.changeset(followed, %{followers: new_followers})
|
||||
|
||||
case Repo.update(changeset) do
|
||||
{:error, changeset} ->
|
||||
|
|
Loading…
Reference in New Issue