defmodule PostlandWeb.DevLive do use PostlandWeb, :live_view use Phoenix.VerifiedRoutes, endpoint: PostlandWeb.Endpoint, router: PostlandWeb.Router alias Postland.Activities def render(assigns) do ~H""" <.button phx-click="make_follower_request">Make follower request """ end def handle_event("make_follower_request", _, socket) do mock_actor = "https://example.com/actors/test" encoded_followee = Base.url_encode64(Postland.my_actor_id(), padding: false) encoded_follower = Base.url_encode64(mock_actor, padding: false) Activities.process_activity(%{ "@context" => "https://www.w3.org/ns/activitystreams", "id" => url(~p"/follows/#{encoded_followee}/#{encoded_follower}"), "type" => "Follow", "actor" => mock_actor, "object" => Postland.my_actor_id() }) {:noreply, socket} end end