Federate unfollow activity in move_following properly
0: Use the CommonAPI unfollow function to make sure the unfollow activity is federated. 1: Limit the follow and unfollow to local followers only, while let the romote servers decide whether to move their followers. Ref: emit-move
This commit is contained in:
parent
e41eee5ed1
commit
4f44fd32ea
2 changed files with 38 additions and 1 deletions
|
|
@ -194,11 +194,12 @@ defmodule Pleroma.FollowingRelationship do
|
|||
|> join(:inner, [r], f in assoc(r, :follower))
|
||||
|> where(following_id: ^origin.id)
|
||||
|> where([r, f], f.allow_following_move == true)
|
||||
|> where([r, f], f.local == true)
|
||||
|> limit(50)
|
||||
|> preload([:follower])
|
||||
|> Repo.all()
|
||||
|> Enum.map(fn following_relationship ->
|
||||
Repo.delete(following_relationship)
|
||||
Pleroma.Web.CommonAPI.unfollow(following_relationship.follower, origin)
|
||||
Pleroma.Web.CommonAPI.follow(following_relationship.follower, target)
|
||||
end)
|
||||
|> case do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue