making it librejs compliant
[KiwiIRC.git] / server / irc / server.js
index 2dec7899c413e291779163c14e252aab8cc11611..42e32dff0b1e71886c74bb0419c125e384342725 100755 (executable)
@@ -1,6 +1,7 @@
 var util    = require('util'),
     EventBinder  = require('./eventbinder.js'),
-    _ = require('lodash');
+    _ = require('lodash'),
+    Stats = require('../stats.js');
 
 var IrcServer = function (irc_connection) {
     this.irc_connection = irc_connection;
@@ -8,6 +9,7 @@ var IrcServer = function (irc_connection) {
     this.list_buffer = [];
     this.motd_buffer = '';
 
+    // Date when registeration with the IRCd had completed
     this.registered = false;
 
     this.irc_events = {
@@ -60,7 +62,8 @@ IrcServer.prototype.reset = function() {
 
 
 function onConnect(event) {
-    this.registered = true;
+    Stats.incr('irc.connection.registered');
+    this.registered = new Date();
 
     this.irc_connection.clientEvent('connect', {
         nick: event.nick