]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
cloak testing
authorChris Porter <redacted>
Sun, 18 Jan 2015 21:54:23 +0000 (21:54 +0000)
committerChris Porter <redacted>
Sun, 18 Jan 2015 21:54:23 +0000 (21:54 +0000)
js/irc/baseircclient.js
js/irc/ircconnection.js
js/qwebircinterface.js

index 908b15ec1f86cfd294d4ce6ec19e40df85cae4fc..d51ed819bfa3e2e12a969cd29d33e8a610325761 100644 (file)
@@ -36,7 +36,8 @@ qwebirc.irc.BaseIRCClient = new Class({
     this.connection = new qwebirc.irc.IRCConnection({
       initialNickname: this.nickname,
       onRecv: this.dispatch.bind(this),
-      serverPassword: this.options.serverPassword
+      serverPassword: this.options.serverPassword,
+      cloak: this.options.cloak
     });
   
     this.send = this.connection.send.bind(this.connection);
index e6cb69cd5f0a5fe6b1ab9fee89459ceb4f948486..53164e824d7f6125b5addc211d2c508f4b61c150 100644 (file)
@@ -420,7 +420,8 @@ qwebirc.irc.IRCConnection = new Class({
     var postdata = "nick=" + encodeURIComponent(this.initialNickname);
     if($defined(this.options.serverPassword))
       postdata+="&password=" + encodeURIComponent(this.options.serverPassword);
-      
+    if($defined(this.options.cloak) && this.options.cloak)
+      postdata+="&cloak=true";
     r.send(postdata);
   },
   __decideTransport: function(transports) {
index fa7b4765bc489cabd846f8a590e87dd06ec137f3..c1eb3c281b579f93f47303bf937387a6ef5bd2cb 100644 (file)
@@ -30,7 +30,8 @@ qwebirc.ui.Interface = new Class({
     nickValidation: null,
     helpURL: null,
     dynamicBaseURL: "/",
-    staticBaseURL: "/"
+    staticBaseURL: "/",
+    cloak: false
   },
   initialize: function(element, ui, options) {
     this.setOptions(options);
@@ -68,6 +69,7 @@ qwebirc.ui.Interface = new Class({
 
     window.addEvent("domready", function() {
       var callback = function(options) {
+        options.cloak = ui_.options.cloak;
         var IRC = new qwebirc.irc.IRCClient(options, ui_);
         IRC.connect();
         window.onbeforeunload = qwebirc_ui_onbeforeunload;
@@ -129,7 +131,10 @@ qwebirc.ui.Interface = new Class({
           
         if(args.contains("randomnick") && args.get("randomnick") == 1)
           inick = this.options.initialNickname;
-          
+
+        if(args.contains("cloak") && args.get("cloak") == 1)
+          this.options.cloak = true;
+
         /* we only consider autoconnecting if the nick hasn't been supplied, or it has and it's not "" */
         if(canAutoConnect && (!$defined(inick) || ($defined(inick) && (inick != "")))) {
           var p = args.get("prompt");