Skip to content

Commit

Permalink
Fixing comparison and adding comments, as per thedjpetersen#194
Browse files Browse the repository at this point in the history
  • Loading branch information
SpenserJ committed Dec 24, 2012
1 parent 51eaec4 commit cd7ea22
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions assets/js/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,10 @@ $(function() {
});

irc.commands.add('topic', function(args){
if (args[0].indexOf('#') == 0 || args[0].indexOf('&') == 0) {
// If args[0] starts with # or &, a topic name has been provided
if (args[0].indexOf('#') === 0 || args[0].indexOf('&') === 0) {
irc.socket.emit('topic', {name: args.shift(), topic: args.join(' ')});
} else {
} else { // Otherwise, assume we're changing the current channel's topic
irc.socket.emit('topic', {name: irc.chatWindows.getActive().get('name'),
topic: args.join(' ')});
}
Expand Down

0 comments on commit cd7ea22

Please sign in to comment.