]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
Use a realname from the config file, also try generating an ID that hasn't been seen...
authorChris Porter <redacted>
Fri, 11 Jul 2008 00:41:31 +0000 (01:41 +0100)
committerChris Porter <redacted>
Fri, 11 Jul 2008 00:41:31 +0000 (01:41 +0100)
config.py.example
js/ui/baseui.js
qwebirc/ajaxengine.py

index c69671e00ef66b6d67c2aea5d29687d9f89e3095..f42409a334dfc02ccae17d4edc8a8540fd788cd2 100644 (file)
@@ -4,3 +4,4 @@ HMACTEMPORAL = 30
 UPDATE_FREQ = 0.5
 MAXBUFLEN = 10000
 MAXSUBSCRIPTIONS = 3
+REALNAME = "http://moo.com/"
index 299ad5e49fcd95dedc57a7ae26d3548ab647935f..26f1bbd4b52f5c1f1cd3b78f44d1a2309889100b 100644 (file)
@@ -18,8 +18,10 @@ var UI = new Class({
     this.selectWindow(w);
     if(!this.firstClient) {
       this.firstClient = true;
-      w.addLine("", "qwebirc v" + QWEBIRC_VERSION + " -- Copyright (C) 2008 Chris Porter. All rights reserved.");
+      w.addLine("", "qwebirc v" + QWEBIRC_VERSION);
+      w.addLine("", "Copyright (C) 2008 Chris Porter. All rights reserved.");
       w.addLine("", "http://webchat.quakenet.org/");
+      w.addLine("", "This is BETA quality software, please report bugs to slug@quakenet.org");
     }
     return w;
   },
index 4c5114603c4ca798de54b5fefbc6759274fcc33d..84b4a0982137cf6973f3f409ee2c517a71b1fb6f 100644 (file)
@@ -12,6 +12,9 @@ def get_session_id():
 class BufferOverflowException(Exception):
   pass
 
+class IDGenerationException(Exception):
+  pass
+
 def jsondump(fn):
   def decorator(*args, **kwargs):
     x = fn(*args, **kwargs)
@@ -131,12 +134,17 @@ class AJAXEngine(resource.Resource):
         return [False, "Nickname not supplied"]
         
       nick = nick[0]
-      
-      id = get_session_id()
-      
+
+      for i in xrange(10):
+        id = get_session_id()
+        if not Sessions.get(id):
+          break
+      else:
+        raise IDGenerationException()
+
       session = IRCSession(id)
 
-      client = ircclient.createIRC(session, nick=nick, ident=ident, ip=ip, realname=nick)
+      client = ircclient.createIRC(session, nick=nick, ident=ident, ip=ip, realname=config.REALNAME)
       session.client = client
       
       Sessions[id] = session