Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed /topic handler

Problem:
/topic This is a test # Would change the topic of channel "This"
    to "is", and ignore the rest
/topic #Channel This is a test # Would change the topic of channel
    "#Channel" to "This" and ignore the rest
Resolution:
If args[0] starts with # or &, a channel has been provided. Set the
    channel's name to args.shift(), and the topic to args.join(' ')
If args[0] does not start with # or &, set the active channel's
    topic to args.join(' ')
  • Loading branch information...
commit 51eaec4be1200bc726a90bc706e771cf6bb70bd0 1 parent 5bfefdc
@SpenserJ SpenserJ authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 assets/js/client.js
View
6 assets/js/client.js
@@ -425,11 +425,11 @@ $(function() {
});
irc.commands.add('topic', function(args){
- if (args[1]) {
- irc.socket.emit('topic', {name: args[0], topic: args[1]});
+ if (args[0].indexOf('#') == 0 || args[0].indexOf('&') == 0) {
+ irc.socket.emit('topic', {name: args.shift(), topic: args.join(' ')});
} else {
irc.socket.emit('topic', {name: irc.chatWindows.getActive().get('name'),
- topic: args[0]});
+ topic: args.join(' ')});
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.