diff --git a/src/categories/recentreplies.js b/src/categories/recentreplies.js index 9651a49c20..f03f65e256 100644 --- a/src/categories/recentreplies.js +++ b/src/categories/recentreplies.js @@ -1,17 +1,18 @@ 'use strict'; -var async = require('async'), - winston = require('winston'), - validator = require('validator'), - _ = require('underscore'), +var async = require('async'); +var winston = require('winston'); +var validator = require('validator'); +var _ = require('underscore'); - db = require('../database'), - posts = require('../posts'), - topics = require('../topics'), - privileges = require('../privileges'); +var db = require('../database'); +var posts = require('../posts'); +var topics = require('../topics'); +var privileges = require('../privileges'); module.exports = function(Categories) { + Categories.getRecentReplies = function(cid, uid, count, callback) { if (!parseInt(count, 10)) { return callback(null, []); diff --git a/src/groups.js b/src/groups.js index 2df5dc3ce2..e572c30110 100644 --- a/src/groups.js +++ b/src/groups.js @@ -349,7 +349,9 @@ var utils = require('../public/src/utils'); Groups.getLatestMemberPosts = function(groupName, max, uid, callback) { async.waterfall([ - async.apply(Groups.getMembers, groupName, 0, -1), + function(next) { + Groups.getMembers(groupName, 0, -1, next); + }, function(uids, next) { if (!Array.isArray(uids) || !uids.length) { return callback(null, []); diff --git a/src/posts.js b/src/posts.js index a3d19e7a7f..c4703f8ae7 100644 --- a/src/posts.js +++ b/src/posts.js @@ -1,14 +1,14 @@ 'use strict'; -var async = require('async'), - _ = require('underscore'), - - db = require('./database'), - utils = require('../public/src/utils'), - user = require('./user'), - topics = require('./topics'), - privileges = require('./privileges'), - plugins = require('./plugins'); +var async = require('async'); +var _ = require('underscore'); + +var db = require('./database'); +var utils = require('../public/src/utils'); +var user = require('./user'); +var topics = require('./topics'); +var privileges = require('./privileges'); +var plugins = require('./plugins'); (function(Posts) { diff --git a/src/posts/category.js b/src/posts/category.js index 68ae42474b..2d8fd97cc0 100644 --- a/src/posts/category.js +++ b/src/posts/category.js @@ -1,8 +1,8 @@ 'use strict'; -var async = require('async'), - topics = require('../topics'); +var async = require('async'); +var topics = require('../topics'); module.exports = function(Posts) { @@ -13,7 +13,7 @@ module.exports = function(Posts) { }, function(tid, next) { topics.getTopicField(tid, 'cid', next); - } + } ], callback); }; diff --git a/src/posts/summary.js b/src/posts/summary.js index 3cb5586bc6..60da66ecad 100644 --- a/src/posts/summary.js +++ b/src/posts/summary.js @@ -1,15 +1,15 @@ 'use strict'; -var async = require('async'), - validator = require('validator'), - S = require('string'), +var async = require('async'); +var validator = require('validator'); +var S = require('string'); - db = require('../database'), - user = require('../user'), - plugins = require('../plugins'), - categories = require('../categories'), - utils = require('../../public/src/utils'); +var db = require('../database'); +var user = require('../user'); +var plugins = require('../plugins'); +var categories = require('../categories'); +var utils = require('../../public/src/utils'); module.exports = function(Posts) { @@ -30,9 +30,7 @@ module.exports = function(Posts) { return callback(err); } - posts = posts.filter(function(p) { - return !!p && parseInt(p.deleted, 10) !== 1; - }); + posts = posts.filter(Boolean); var uids = [], topicKeys = []; for(var i=0; i