Skip to content

Commit

Permalink
Renamed connectToChannel and disconnectFromChannel methods to subscri…
Browse files Browse the repository at this point in the history
…be and unsubscribe
  • Loading branch information
szimek committed Feb 28, 2009
1 parent 99695ed commit 6e35ade
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions media/juggernaut.js
Expand Up @@ -104,7 +104,7 @@ Juggernaut.fn.receiveData = function(e) {
eval(msg.body);
};

Juggernaut.fn.connectToChannel = function(channel) {
Juggernaut.fn.subscribe = function(channel) {
if(this.is_connected && this.options.channels.indexOf(channel) == -1) {
this.options.channels.push(channel);

Expand All @@ -113,11 +113,11 @@ Juggernaut.fn.connectToChannel = function(channel) {
handshake.type = "add_channels_to_client";
handshake.channels = [channel];
this.sendData(Juggernaut.toJSON(handshake));
this.logger("Connecting to channel: " + channel);
this.logger("Subscribed to channel: " + channel);
}
};

Juggernaut.fn.disconnectFromChannel = function(channel) {
Juggernaut.fn.unsubscribe = function(channel) {
if(this.is_connected && this.options.channels.indexOf(channel) != -1) {
this.options.channels.splice(this.options.channels.indexOf(channel), 1);

Expand All @@ -126,7 +126,7 @@ Juggernaut.fn.disconnectFromChannel = function(channel) {
handshake.type = "remove_channels_from_client";
handshake.channels = [channel];
this.sendData(Juggernaut.toJSON(handshake));
this.logger("Disconnecting from channel: " + channel);
this.logger("Unsubscribed from channel: " + channel);
}
};

Expand Down

0 comments on commit 6e35ade

Please sign in to comment.