Pleroma v1.1.9-10-g42f76306+dev Pleroma.Web.ChatChannel View Source
Link to this section Summary
Functions
Handle incoming event
s.
Handle regular Elixir process messages.
Handle channel joins by topic
.
Link to this section Functions
Handle incoming event
s.
Example
def handle_in("ping", payload, socket) do
{:reply, {:ok, payload}, socket}
end
Callback implementation for Phoenix.Channel.handle_in/3
.
Handle regular Elixir process messages.
Callback implementation for Phoenix.Channel.handle_info/2
.
Handle channel joins by topic
.
To authorize a socket, return {:ok, socket}
or {:ok, reply, socket}
. To
refuse authorization, return {:error, reason}
.
Example
def join("room:lobby", payload, socket) do
if authorized?(payload) do
{:ok, socket}
else
{:error, %{reason: "unauthorized"}}
end
end
Callback implementation for Phoenix.Channel.join/3
.