From ffd60654b145acc7b8b233d560db64b29a993814 Mon Sep 17 00:00:00 2001 From: reality Date: Thu, 17 Oct 2013 03:06:17 +0000 Subject: [PATCH] inception times for all --- modules/sstats/api.js | 6 ++++-- modules/sstats/sstats.js | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/sstats/api.js b/modules/sstats/api.js index 2ca5a30..589ee64 100644 --- a/modules/sstats/api.js +++ b/modules/sstats/api.js @@ -13,7 +13,8 @@ var api = function(dbot) { var uStats = { 'id': id, 'lines': 0, - 'channels': {} + 'channels': {}, + 'creation': new Date().getTime() }; this.db.save('user_stats', id, uStats, function(err, uStats) { callback(uStats); @@ -29,7 +30,8 @@ var api = function(dbot) { 'createChannelStats': function(id, callback) { var cStats = { 'id': id, - 'lines': 0 + 'lines': 0, + 'creation': new Date().getTime() }; this.db.save('channel_stats', id, cStats, function(err, cStats) { callback(cStats); diff --git a/modules/sstats/sstats.js b/modules/sstats/sstats.js index c093abd..c8bbfdb 100644 --- a/modules/sstats/sstats.js +++ b/modules/sstats/sstats.js @@ -5,6 +5,8 @@ var _ = require('underscore')._; var sstats = function(dbot) { + if(!_.has(dbot.db, 'ssinception')) dbot.db.ssinception = new Date().getTime(); + this.listener = function(event) { event.cStats.lines++; event.uStats.lines++;