X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Factivity_pub%2Factivity_pub.ex;h=4e46e80ea1128b4a2b15745be32ebdc7c678c374;hb=8b1154633430d2f2c0cb7375bec66cf7f0f35583;hp=fb33f2e3ef2eddfc6e637fab797673acc3d0a443;hpb=010f818a29d813e912cc38b3bdc259bed9837ed9;p=akkoma diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index fb33f2e3e..4e46e80ea 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -273,6 +273,12 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do } User.insert_or_update_user(user_data) + if user = User.get_by_ap_id(ap_id) do + User.info_changeset(user, user_data} + |> Repo.update + else + User.insert_or_update_user(user_data) + end end end @@ -283,7 +289,12 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do end def publish(actor, activity) do - {:ok, followers} = User.get_followers(actor) + followers = if actor.follower_address in activity.recipients do + {:ok, followers} = User.get_followers(actor) + followers + else + [] + end remote_inboxes = (Pleroma.Web.Salmon.remote_users(activity) ++ followers) |> Enum.filter(fn (user) -> User.ap_enabled?(user) end)