     handle_in(nil, message, new_state, new_socket)
   end
 
-  defp handle_in({pid, _ref}, message, state, socket) do
+  defp handle_in({pid, _ref, _status}, message, state, socket) do
     send(pid, message)
-    {:ok, {state, socket}}
+    {:ok, {maybe_put_status(state, pid, message), socket}}
   end
 
   defp handle_in(nil, %{event: "phx_leave", ref: ref, topic: topic, join_ref: join_ref}, state, socket) do

    end
  end

  defp handle_in({pid, _ref}, %{event: "phx_join", topic: topic} = message, state, socket) do
    receive do
      {:socket_close, ^pid, _reason} -> :ok
    after
      0 ->
        Logger.debug(fn ->
          "Duplicate channel join for topic \"#{topic}\" in #{inspect(socket.handler)}. " <>
          "Closing existing channel for new join."
        end)
    end

    :ok = shutdown_duplicate_channel(pid)


    %{
      state |
        channels: Map.put(channels, topic, {pid, monitor_ref, :joined}),
        channels_inverse: Map.put(channels_inverse, pid, {topic, join_ref})
    }
  end
