Change 'logs/' location
This commit is contained in:
parent
193b30b8a7
commit
dcdec78c4e
@ -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) {
|
||||
|
@ -81,7 +81,7 @@ ClientManager.prototype.addUser = function(name, password) {
|
||||
var user = {
|
||||
user: name,
|
||||
password: password || "",
|
||||
logs: false,
|
||||
log: false,
|
||||
networks: []
|
||||
};
|
||||
fs.mkdirSync(path);
|
||||
|
@ -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 = {
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user