fixed unfollow for relay actor

This commit is contained in:
Maksim Pechnikov 2019-08-22 06:57:55 +03:00
commit 64bfb41c55
4 changed files with 48 additions and 1 deletions

View file

@ -36,7 +36,8 @@ defmodule Pleroma.Web.ActivityPub.Relay do
def unfollow(target_instance) do
with %User{} = local_user <- get_actor(),
{:ok, %User{} = target_user} <- User.get_or_fetch_by_ap_id(target_instance),
{:ok, activity} <- ActivityPub.unfollow(local_user, target_user) do
{:ok, activity} <- ActivityPub.unfollow(local_user, target_user),
{:ok, _, _} <- User.unfollow(local_user, target_user) do
Logger.info("relay: unfollowed instance: #{target_instance}: id=#{activity.data["id"]}")
{:ok, activity}
else