         |> Romeo.JID.parse
 
       Logger.info fn -> "Bound to resource: #{resource}" end
+      Kernel.send(owner, {:resource_bound, resource})
       %{conn | resource: resource}
     end)
   end

    |> negotiate_features
  end

  defp bind(%Conn{resource: resource} = conn) do
    stanza = Romeo.Stanza.bind(resource)
    id = Romeo.XML.attr(stanza, "id")


  end

  defp ready(%Conn{owner: owner} = conn) do
    Kernel.send(owner, :connection_ready)
    {:ok, conn}
  end

