style changes

v1.18.x
Barış Soner Uşaklı
parent bcc566fb68
commit 890c2eff70

@ -1,14 +1,14 @@
'use strict';
(function (module) {
var fork = require('child_process').fork;
var path = require('path');
module.hash = function (rounds, password, callback) {
exports.hash = function (rounds, password, callback) {
forkChild({ type: 'hash', rounds: rounds, password: password }, callback);
};
module.compare = function (password, hash, callback) {
exports.compare = function (password, hash, callback) {
if (!hash || !password) {
return setImmediate(callback, null, false);
}
@ -32,6 +32,3 @@
child.send(message);
}
return module;
}(exports));

@ -14,7 +14,8 @@ var file = require('./file');
var app;
var middleware;
(function (Plugins) {
var Plugins = module.exports;
require('./plugins/install')(Plugins);
require('./plugins/load')(Plugins);
require('./plugins/hooks')(Plugins);
@ -361,4 +362,3 @@ var middleware;
},
], callback);
};
}(exports));

@ -12,7 +12,8 @@ var categories = require('./categories');
var privileges = require('./privileges');
var social = require('./social');
(function (Topics) {
var Topics = module.exports;
require('./topics/data')(Topics);
require('./topics/create')(Topics);
require('./topics/delete')(Topics);
@ -278,40 +279,44 @@ var social = require('./social');
if (!Array.isArray(tids) || !tids.length) {
return callback(null, []);
}
Topics.getTopicsFields(tids, ['mainPid'], function (err, topicData) {
if (err) {
return callback(err);
}
async.waterfall([
function (next) {
Topics.getTopicsFields(tids, ['mainPid'], next);
},
function (topicData, next) {
var mainPids = topicData.map(function (topic) {
return topic && topic.mainPid;
});
callback(null, mainPids);
});
next(null, mainPids);
},
], callback);
};
Topics.getMainPosts = function (tids, uid, callback) {
Topics.getMainPids(tids, function (err, mainPids) {
if (err) {
return callback(err);
}
getMainPosts(mainPids, uid, callback);
});
async.waterfall([
function (next) {
Topics.getMainPids(tids, next);
},
function (mainPids, next) {
getMainPosts(mainPids, uid, next);
},
], callback);
};
function getMainPosts(mainPids, uid, callback) {
posts.getPostsByPids(mainPids, uid, function (err, postData) {
if (err) {
return callback(err);
}
async.waterfall([
function (next) {
posts.getPostsByPids(mainPids, uid, next);
},
function (postData, next) {
postData.forEach(function (post) {
if (post) {
post.index = 0;
}
});
Topics.addPostData(postData, uid, callback);
});
Topics.addPostData(postData, uid, next);
},
], callback);
}
Topics.isLocked = function (tid, callback) {
@ -330,4 +335,3 @@ var social = require('./social');
callback(new Error('[[error:no-plugins-available]]'), []);
}
};
}(exports));

@ -12,7 +12,8 @@ var db = require('../database');
var meta = require('../meta');
var emailer = require('../emailer');
(function (UserEmail) {
var UserEmail = module.exports;
UserEmail.exists = function (email, callback) {
user.getUidByEmail(email.toLowerCase(), function (err, exists) {
callback(err, !!exists);
@ -114,4 +115,3 @@ var emailer = require('../emailer');
callback(err);
});
};
}(exports));

@ -12,7 +12,8 @@ var db = require('../database');
var meta = require('../meta');
var emailer = require('../emailer');
(function (UserReset) {
var UserReset = module.exports;
var twoHours = 7200000;
UserReset.validate = function (code, callback) {
@ -165,4 +166,3 @@ var emailer = require('../emailer');
},
], callback);
};
}(exports));

Loading…
Cancel
Save