parent
e6dc15b96c
commit
8d11bae0d5
3 changed files with 75 additions and 0 deletions
|
|
@ -241,6 +241,24 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||
end
|
||||
end
|
||||
|
||||
def handle_incoming(
|
||||
%{
|
||||
"type" => "Undo",
|
||||
"object" => %{"type" => "Follow", "object" => followed},
|
||||
"actor" => follower,
|
||||
"id" => id
|
||||
} = data
|
||||
) do
|
||||
with %User{local: true} = followed = User.get_cached_by_ap_id(followed),
|
||||
%User{} = follower = User.get_or_fetch_by_ap_id(follower),
|
||||
{:ok, activity} <- ActivityPub.unfollow(follower, followed, false) do
|
||||
User.unfollow(follower, followed)
|
||||
{:ok, activity}
|
||||
else
|
||||
e -> :error
|
||||
end
|
||||
end
|
||||
|
||||
# TODO
|
||||
# Accept
|
||||
# Undo for non-Announce
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue