Fix code that ignores capability modifiers
authorJack Allnutt <jack@allnutt.eu>
Sat, 28 Sep 2013 16:52:25 +0000 (17:52 +0100)
committerJack Allnutt <jack@allnutt.eu>
Sat, 28 Sep 2013 16:52:25 +0000 (17:52 +0100)
No longer remove a '-' from the middle of a capability name

server/irc/commands.js

index 4778c9eeac55dc2777715b96c112615cdf93ceda..e37d454491e79d14cfa7ff8b5735dd98710cf611 100644 (file)
@@ -539,7 +539,7 @@ handlers = {
     'CAP': function (command) {
         // TODO: capability modifiers
         // i.e. - for disable, ~ for requires ACK, = for sticky
-        var capabilities = command.trailing.replace(/[\-~=]/, '').split(' ');
+        var capabilities = command.trailing.replace(/(?:^| )[\-~=]/, '').split(' ');
         var request;
 
         // Which capabilities we want to enable