unsubscribe missing #45

Open
mrbrdo opened this Issue Mar 12, 2012 · 2 comments

Comments

Projects
None yet
3 participants

mrbrdo commented Mar 12, 2012

It seems unsubscribe functionality is missing. "sign"-ing twice to the same channel makes duplicate messages.

I second this feature. It would be nice to be able to subscribe and unsubscribe, especially when you're working with full-JS front-end applications, like the ones you write in Backbone, Spine, Ember, Knockout, Knockback, Batman, Sproutcore, etc.

Being able to toggle between subscribe and unsubscribe would be a great addition, even if it means having to set the expiration to never. It should be safe enough when going over an HTTPS protocol I assume.

nir0 commented Apr 27, 2012

a hack:

  :javascript
    if(!$(window).data("connected")){
    #{subscribe_to("/chat/#{@chat.id}").gsub('</script>', '').gsub('<script type="text/javascript">','')}
    $(window).data("connected", true)
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment