Fixed /topic handler #194

Merged
merged 2 commits into from Dec 28, 2012

Conversation

Projects
None yet
2 participants
Contributor

SpenserJ commented Dec 24, 2012

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(' ')

@SpenserJ SpenserJ 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(' ')
51eaec4

@thedjpetersen thedjpetersen commented on an outdated diff Dec 24, 2012

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) {
@thedjpetersen

thedjpetersen Dec 24, 2012

Owner

Just the same style comment: ===, and maybe a comment on what this comparison is doing then it looks good

@thedjpetersen thedjpetersen added a commit that referenced this pull request Dec 28, 2012

@thedjpetersen thedjpetersen Merge pull request #194 from SpenserJ/fix_topic_command_handler
Fixed /topic handler
b6ce807

@thedjpetersen thedjpetersen merged commit b6ce807 into thedjpetersen:master Dec 28, 2012

Owner

thedjpetersen commented Dec 28, 2012

Thanks!

SpenserJ deleted the SpenserJ:fix_topic_command_handler branch Dec 28, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment