Canceling users subscription

5 views
Skip to first unread message

thrykol

unread,
May 16, 2011, 11:21:09 AM5/16/11
to Hookbox User Group
Hi,

Once a users cancels their subscription to a channel, it appears that
no other users in that channel can cancel. In js_src/hookbox.js the
cancel() function checks to see if the property is set and does not
take any actions if it is true. I'm not strong in Python but it seems
there may be a scope issue. I have gotten around the issue in my
environment by resetting the property in my javascript code after a
cancel occurs (may result in some race conditions though).

The following is a sample of my implementation. Is there something I
am doing wrong?

connection.onSubscribed = function(channel, subscription) {
self._hookbox.subscription[channel] = subscription;
}

...

$(".unsubscribe").bind("click", function() {
var channel = $(this).prop("channel");
self._hookbox.subscription[channel].canceled = false; // my hack
self._hookbox.subscription[channel].cancel();
});

Thanks.
Reply all
Reply to author
Forward
0 new messages