Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Fixed channels HTTP API endpoint #127

Merged
merged 4 commits into from
May 11, 2019
Merged

Fixed channels HTTP API endpoint #127

merged 4 commits into from
May 11, 2019

Conversation

Catzilla
Copy link
Contributor

@Catzilla Catzilla commented Mar 5, 2019

Fixes #149

Currently, we can only get presence channels, because there is a filter in code:

$channels = Collection::make($this->channelManager->getChannels($request->appId))->filter(function ($channel) {
return $channel instanceof PresenceChannel;
});

But according to Pusher API documentation, there is no limitations needed, and presence channels should be filtered using filter_by_prefix=presence-:

https://pusher.com/docs/rest_api#method-get-channels

In this pull request, I implemented correct behavior for this endpoint:

  • List with all channels now returned
  • Attribute user_count must be requested via info query param
  • Error code 400 will be returned if user_count is requested, and the request is not limited to presence channels

@francislavoie
Copy link
Contributor

Looks like the pusher docs URLs have changed. The new URL is https://pusher.com/docs/channels/library_auth_reference/rest-api#get-channels-fetch-info-for-multiple-channels-

@mpociot mpociot merged commit d145cd4 into beyondcode:master May 11, 2019
@mpociot
Copy link
Member

mpociot commented May 11, 2019

Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to get private channels
3 participants