Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Creating private channels #107

Open
RickS1 opened this issue Dec 24, 2014 · 2 comments
Open

Creating private channels #107

RickS1 opened this issue Dec 24, 2014 · 2 comments

Comments

@RickS1
Copy link

RickS1 commented Dec 24, 2014

Hi!

I'm using this incredible gem to implement a chat application. It's been working great, according to what the RailsCast shows; however, I'm wondering how can I create multiple channels so I can have private sessions? I haven't found any examples of that and, although "/messages/new" works perfectly, it broadcasts the conversation to all chat windows (and this is unwanted).

Thanks in advance! And sorry if my question seems dumb.

@spacewaffle
Copy link

You'll want to dynamically change the url for each channel you want to support. For example,

subscribe_to "/messages/1"
These subscribers will only get messages from channel 1.

subscribe_to "/messages/2"
These subscribers will only get messages from channel 2.

@RickS1
Copy link
Author

RickS1 commented Jan 8, 2015

And does the wildcard () also applies with this gem? I've been reading from Faye documentation that it is useful to subscribe to any available channel (for example, subscribe_to "messages/" will subscribe the user to every channel). This doubt is because I need to implement a one-to-many chat like application, and obviously one specific user needs to be subscribed to every channel to answer each and any of the conversations.

Thanks in advance!

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

No branches or pull requests

2 participants