def increase_poll_votes_if_vote(_create_data), do: :noop
- @spec insert(map(), boolean(), boolean(), boolean()) :: {:ok, Activity.t()} | {:error, any()}
- # TODO rewrite in with style
@spec persist(map(), keyword()) :: {:ok, Activity.t() | Object.t()}
def persist(object, meta) do
with local <- Keyword.fetch!(meta, :local),
end
end
+ @spec insert(map(), boolean(), boolean(), boolean()) :: {:ok, Activity.t()} | {:error, any()}
def insert(map, local \\ true, fake \\ false, bypass_actor_check \\ false) when is_map(map) do
with nil <- Activity.normalize(map),
map <- lazy_put_activity_defaults(map, fake),
def validate_object_presence(cng, field_name \\ :object) do
cng
- |> validate_change(field_name, fn field_name, actor ->
- if Object.get_cached_by_ap_id(actor) do
+ |> validate_change(field_name, fn field_name, object ->
+ if Object.get_cached_by_ap_id(object) do
[]
else
- [{field_name, "can't find user"}]
+ [{field_name, "can't find object"}]
end
end)
end