mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-27 16:24:23 +00:00
Hook unfollow into TwitterAPI
This commit is contained in:
parent
b2c6ae7d82
commit
55f9aefd08
|
@ -36,14 +36,7 @@ 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.insert(%{
|
||||
"type" => "Undo",
|
||||
"actor" => follower.ap_id,
|
||||
# get latest Follow for these users
|
||||
"object" => follow_activity.data["id"],
|
||||
"published" => make_date()
|
||||
}) do
|
||||
{:ok, _activity} <- ActivityPub.unfollow(follower, unfollowed) do
|
||||
{:ok, follower, unfollowed}
|
||||
else
|
||||
err -> err
|
||||
|
|
Loading…
Reference in a new issue