Change 'logs/' location

This commit is contained in:
Mattias Erming 2014-10-14 21:25:04 +02:00
parent 193b30b8a7
commit dcdec78c4e
3 changed files with 41 additions and 41 deletions

View File

@ -77,7 +77,8 @@ Client.prototype.emit = function(event, data) {
if (this.sockets !== null) {
this.sockets.in(this.id).emit(event, data);
}
if ((this.config || {}).log === true) {
var config = this.config || {};
if (config.log === true) {
if (event == "msg") {
var target = this.find(data.chan);
if (target) {

View File

@ -81,7 +81,7 @@ ClientManager.prototype.addUser = function(name, password) {
var user = {
user: name,
password: password || "",
logs: false,
log: false,
networks: []
};
fs.mkdirSync(path);

View File

@ -3,12 +3,12 @@ var mkdirp = require("mkdirp");
var moment = require("moment");
var Helper = require("./helper");
module.exports = {
write: function(user, network, chan, msg) {
var path = Helper.HOME + "/users/" + user + "/logs/" + network;
module.exports.write = function(user, network, chan, msg) {
try {
var path = Helper.HOME + "/logs/" + user + "/" + network;
mkdirp.sync(path);
} catch(e) {
console.log(e);
return;
}
@ -42,5 +42,4 @@ module.exports = {
}
}
);
}
};