Unify unfollow, accept and reject follow requests using CommonAPI

This commit is contained in:
eugenijm 2019-03-13 09:04:49 +03:00
commit e416c344dd
4 changed files with 42 additions and 46 deletions

View file

@ -35,11 +35,8 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
def unfollow(%User{} = follower, params) do
with {:ok, %User{} = unfollowed} <- get_user(params),
{:ok, follower, _follow_activity} <- User.unfollow(follower, unfollowed),
{:ok, _activity} <- ActivityPub.unfollow(follower, unfollowed) do
{:ok, follower} <- CommonAPI.unfollow(follower, unfollowed) do
{:ok, follower, unfollowed}
else
err -> err
end
end