- def handle_incoming(%{"type" => "Like"} = data, _options) do
- with {_, {:ok, cast_data_sym}} <-
- {:casting_data,
- data |> LikeValidator.cast_data() |> Ecto.Changeset.apply_action(:insert)},
- {_, cast_data} <-
- {:stringify_keys, ObjectValidator.stringify_keys(cast_data_sym |> Map.from_struct())},
- :ok <- ObjectValidator.fetch_actor_and_object(cast_data),
- {_, {:ok, cast_data}} <- {:maybe_add_context, maybe_add_context_from_object(cast_data)},
- {_, {:ok, cast_data}} <-
- {:maybe_add_recipients, maybe_add_recipients_from_object(cast_data)},
- {_, {:ok, activity, _meta}} <-
- {:common_pipeline, Pipeline.common_pipeline(cast_data, local: false)} do
+ def handle_incoming(%{"type" => type} = data, _options) when type in ["Like", "EmojiReact"] do
+ with :ok <- ObjectValidator.fetch_actor_and_object(data),
+ {:ok, activity, _meta} <-
+ Pipeline.common_pipeline(data, local: false) do