From 5c845ac27fdee03cb09f462ba9f603f3848916e5 Mon Sep 17 00:00:00 2001 From: Darren Date: Thu, 13 Oct 2011 23:37:27 +0100 Subject: [PATCH] Auto nick generation --- server/app.js | 8 ++++++++ 1 file changed, 8 insertions(+) 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') -- 2.25.1