]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
Remove some more QuakeNet-isms from qwebirc.
authorChris Porter <redacted>
Sat, 28 Mar 2009 19:28:03 +0000 (19:28 +0000)
committerChris Porter <redacted>
Sat, 28 Mar 2009 19:28:03 +0000 (19:28 +0000)
Add config options that define the network/app title/other things.

bin/pagegen.py
config.py.example
js/irc/ircclient.js
js/qwebircinterface.js
qwebirc/engines/ajaxengine.py

index e183dcd0580ab043cb1c941e43fb3667446ae17f..140fc9145d29882ab00c109fe2f0bd07ed484501 100755 (executable)
@@ -1,4 +1,4 @@
-import os, sys, pages, subprocess, re
+import os, sys, pages, subprocess, re, optionsgen
 
 class HGException(Exception):
   pass
@@ -63,7 +63,7 @@ def producehtml(name, debug):
 %s%s
 %s
   <script type="text/javascript">
-    var ui = new qwebirc.ui.Interface("ircui", qwebirc.ui.%s);
+    var ui = new qwebirc.ui.Interface("ircui", qwebirc.ui.%s, %s);
   </script>
 </head>
 <body>
@@ -74,7 +74,7 @@ def producehtml(name, debug):
   </div>
 </body>
 </html>
-""" % (ui["doctype"], csshtml, customjs, jshtml, ui["class"], div)
+""" % (ui["doctype"], csshtml, customjs, jshtml, ui["class"], optionsgen.get_options(), div)
 
 def main(outputdir=".", produce_debug=True):
   p = os.path.join(outputdir, "static")
index 595e2c4f258d4e3a98f278d8bc4cbeeca31a8ce3..6c6e175dd8e635aafdcd3634d77699b71e464cb3 100644 (file)
@@ -17,9 +17,13 @@ HTTP_AJAX_REQUEST_TIMEOUT = 30
 # optional default arguments:
 # ARGS = "-n -p 3989"
 
+NETWORK_NAME = "FooNet"
+APP_TITLE = "FooNet Web IRC"
+
 # the following are only really useful for quakenet but still need to be set
 HMACKEY = "mrmoo"
 HMACTEMPORAL = 30
 AUTHGATEDOMAIN = "webchat_test"
 QTICKETKEY = "boo"
-QBOT = "Q@CServe.quakenet.org"
+AUTH_SERVICE = "Q!TheQBot@CServe.quakenet.org"
+AUTH_OK_REGEX = "^You are now logged in as [^ ]+\\.$"
index a4933f00439c7733c0dc1110be1f559a2187801b..589651b52d283547ec4bd552a5436a1d7c841cd8 100644 (file)
@@ -218,7 +218,7 @@ qwebirc.irc.IRCClient = new Class({
         this.activeTimers.autojoin = function() {
           var w = this.ui.getActiveWindow();
           w.errorMessage("No login response in 10 seconds.");
-          w.errorMessage("You may want to try authing to Q and then type: /autojoin (if you don't auth your host may be visible).");
+          w.errorMessage("You may want to try authing manually and then type: /autojoin (if you don't auth your host may be visible).");
         }.delay(10000, this);
         return;
       }
@@ -407,7 +407,7 @@ qwebirc.irc.IRCClient = new Class({
   },
   checkLogin: function(user, message) {
     if(this.isNetworkService(user) && $defined(this.activeTimers.autojoin)) {
-      if(message.match(this.loginRegex)) {
+      if($defined(this.loginRegex) && message.match(this.loginRegex)) {
         $clear(this.activeTimers.autojoin);
         delete this.activeTimers["autojoin"];
         this.ui.getActiveWindow().infoMessage("Joining channels...");
index 9c9e088099fa3dab43b8dd372d3fa7bca0a37546..f4ba09205fb303973d2133c3329a3ce2b042cd32 100644 (file)
@@ -3,10 +3,10 @@ qwebirc.ui.Interface = new Class({
   options: {
     initialNickname: "qwebirc" + Math.ceil(Math.random() * 100000),
     initialChannels: "",
-    networkName: "QuakeNet",
-    networkServices: ["Q!TheQBot@CServe.quakenet.org"],
-    loginRegex: "^You are now logged in as [^ ]+\\.$",
-    appTitle: "QuakeNet Web IRC",
+    networkName: "ExampleNetwork",
+    networkServices: [],
+    loginRegex: null,
+    appTitle: "ExampleNetwork Web IRC",
     searchURL: true,
     theme: undefined
   },
index d30b0c86e803bc39c41af2a3e911e51a5ecc0478..5fab9cf4c4f00c95d4cce6869be941e4211c141f 100644 (file)
@@ -201,7 +201,9 @@ class AJAXEngine(resource.Resource):
     if qticket is None:
       perform = None
     else:
-      perform = ["PRIVMSG %s :TICKETAUTH %s" % (config.QBOT, qticket)]
+      service_mask = config.AUTH_SERVICE
+      msg_mask = service_mask.split("!")[0] + "@" + service_mask.split("@", 1)[1]
+      perform = ["PRIVMSG %s :TICKETAUTH %s" % (msg_mask, qticket)]
 
     self.__connect_hit()
     client = ircclient.createIRC(session, nick=nick, ident=ident, ip=ip, realname=realname, perform=perform)