|
|
|
@ -532,10 +532,20 @@ var async = require('async'),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Posts.getPidIndex = function(pid, uid, callback) {
|
|
|
|
|
callback = callback || function() {};
|
|
|
|
|
// Making uid optional
|
|
|
|
|
if ((!uid && !callback) || typeof uid === 'function') {
|
|
|
|
|
callback = uid;
|
|
|
|
|
uid = undefined;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async.parallel({
|
|
|
|
|
settings: function(next) {
|
|
|
|
|
user.getSettings(uid, next);
|
|
|
|
|
if (uid) {
|
|
|
|
|
user.getSettings(uid, next);
|
|
|
|
|
} else {
|
|
|
|
|
// No uid specified, so return empty object so that the check below will assume regular topic post sorting
|
|
|
|
|
next(null, {});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
tid: function(next) {
|
|
|
|
|
Posts.getPostField(pid, 'tid', next);
|
|
|
|
|