]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
support CHANTYPES
authorChris Porter <redacted>
Mon, 11 Aug 2014 16:53:57 +0000 (17:53 +0100)
committerChris Porter <redacted>
Mon, 11 Aug 2014 16:53:57 +0000 (17:53 +0100)
js/irc/baseircclient.js
js/qwebircinterface.js

index 7722b24337717647ba5b22ee901e4ba76bdf8e97..e448201c70bd60773b45dc5962dd3a94b5adc22e 100644 (file)
@@ -29,8 +29,9 @@ qwebirc.irc.BaseIRCClient = new Class({
 
     this.__signedOn = false;
     this.pmodes = {b: qwebirc.irc.PMODE_LIST, l: qwebirc.irc.PMODE_SET_ONLY, k: qwebirc.irc.PMODE_SET_UNSET, o: qwebirc.irc.PMODE_SET_UNSET, v: qwebirc.irc.PMODE_SET_UNSET};
-    this.channels = {}
-    this.nextctcp = 0;    
+    this.channels = {};
+    this.chanPrefixes = {"#": true, "&": true};
+    this.nextctcp = 0;
 
     this.connection = new qwebirc.irc.IRCConnection({
       initialNickname: this.nickname,
@@ -79,7 +80,7 @@ qwebirc.irc.BaseIRCClient = new Class({
   },
   isChannel: function(target) {
     var c = target.charAt(0);
-    return c == '#';
+    return this.chanPrefixes[c] === true;
   },
   supported: function(key, value) {
     if(key == "CASEMAPPING") {
@@ -96,6 +97,10 @@ qwebirc.irc.BaseIRCClient = new Class({
       for(var i=0;i<smodes.length;i++)
         for(var j=0;j<smodes[i].length;j++)
           this.pmodes[smodes[i].charAt(j)] = i;
+    } else if(key == "CHANTYPES") {
+      this.chanPrefixes = {};
+      for(var i=0;i<value.length;i++)
+        this.chanPrefixes[value.charAt(i)] = true;
     } else if(key == "PREFIX") {
       var l = (value.length - 2) / 2;
       
index 1d7f249a6701d4e9a34a52deff10520304a62a54..c451287177b03efa404674c5c98fd946d5447f9c 100644 (file)
@@ -88,8 +88,9 @@ qwebirc.ui.Interface = new Class({
           
             for(var i=0;i<chans.length;i++) {
               chans2[i] = chans[i];
-            
-              if(chans[i].charAt(0) != '#')
+
+                var prefix = chans[i].charAt(0);
+                if(prefix != '#' && prefix != '&')
                 chans2[i] = "#" + chans2[i]
             }
             cdata[0] = chans2.join(",");