Rename make_unannounce_data helper to make_undo_data
This makes it a bit more easier to adapt for unlikes as well in the future.
This commit is contained in:
parent
f0798440de
commit
c649ca8958
|
@ -142,7 +142,7 @@ def announce(
|
||||||
|
|
||||||
def unannounce(%User{} = actor, %Object{} = object, local \\ true) do
|
def unannounce(%User{} = actor, %Object{} = object, local \\ true) do
|
||||||
with %Activity{} = activity <- get_existing_announce(actor.ap_id, object),
|
with %Activity{} = activity <- get_existing_announce(actor.ap_id, object),
|
||||||
unannounce_data <- make_unannounce_data(actor, activity),
|
unannounce_data <- make_undo_data(actor, activity),
|
||||||
{:ok, unannounce_activity} <- insert(unannounce_data, local),
|
{:ok, unannounce_activity} <- insert(unannounce_data, local),
|
||||||
:ok <- maybe_federate(activity),
|
:ok <- maybe_federate(activity),
|
||||||
{:ok, _activity} <- Repo.delete(activity),
|
{:ok, _activity} <- Repo.delete(activity),
|
||||||
|
|
|
@ -279,9 +279,9 @@ def make_announce_data(
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Make unannounce activity data for the given actor and object
|
Make undo activity data for the given actor and object
|
||||||
"""
|
"""
|
||||||
def make_unannounce_data(
|
def make_undo_data(
|
||||||
%User{ap_id: ap_id} = user,
|
%User{ap_id: ap_id} = user,
|
||||||
%Activity{data: %{"id" => id, "context" => context}} = activity
|
%Activity{data: %{"id" => id, "context" => context}} = activity
|
||||||
) do
|
) do
|
||||||
|
|
Loading…
Reference in New Issue