How could i use Email id as custom channel name using private_pub gem in ruby on rails?

34 Views Asked by At

I am using private_pub gem for chat. When im using email_is of user as custom channel name it throws invalid channel error. How could i used email_id as channel name?

1

There are 1 best solutions below

0
Mitch VanDuyn On

the channel is url path like this "/messages/new"

So you would like the url to be "/messages/:id/new"

where :id = your email.

However you will have to escape the email first or hash it like this:

CGI.escape email_address # to escape characters

Digest::SHA1.hexdigest email_address # to convert to SHA