From: Darren Date: Thu, 13 Oct 2011 22:37:27 +0000 (+0100) Subject: Auto nick generation X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5c845ac27fdee03cb09f462ba9f603f3848916e5;p=KiwiIRC.git Auto nick generation --- diff --git a/server/app.js b/server/app.js index cbaff4d..a0bc999 100644 --- a/server/app.js +++ b/server/app.js @@ -645,6 +645,14 @@ this.httpHandler = function (request, response) { nick = uri.query.nick || ''; } + // Set the default nick if one isn't provided + if (nick == '') { + nick = 'kiwi_?'; + } + + // Set any random numbers if needed + nick = nick.replace('?', Math.floor(Math.random()*100000).toString()); + response.setHeader('X-Generated-By', 'KiwiIRC'); hash = crypto.createHash('md5').update(touchscreen ? 't' : 'f') .update(debug ? 't' : 'f')