   alias Poxa.PresenceSubscription
   alias Poxa.Channel
   alias Poxa.PusherEvent
+  alias Poxa.Registry
   require Logger
 
   @doc """

      if Channel.presence?(channel) do
        PresenceSubscription.unsubscribe!(channel);
      end
      Poxa.Registry.unsubscribe(channel)
    else
      Logger.debug "Not subscribed to"
    end

      Logger.info "Already subscribed #{inspect self} on channel #{channel}"
    else
      Logger.info "Registering #{inspect self} to channel #{channel}"
      Registry.subscribe(channel)
    end
    {:ok, channel}
  end
