Add config options that define the network/app title/other things.
-import os, sys, pages, subprocess, re
+import os, sys, pages, subprocess, re, optionsgen
class HGException(Exception):
pass
%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>
</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")
# 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 [^ ]+\\.$"
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;
}
},
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...");
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
},
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)