|
|
|
@ -1,15 +1,16 @@
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
var async = require('async'),
|
|
|
|
|
_ = require('underscore'),
|
|
|
|
|
|
|
|
|
|
db = require('./database'),
|
|
|
|
|
posts = require('./posts'),
|
|
|
|
|
utils = require('../public/src/utils'),
|
|
|
|
|
plugins = require('./plugins'),
|
|
|
|
|
user = require('./user'),
|
|
|
|
|
categories = require('./categories'),
|
|
|
|
|
privileges = require('./privileges');
|
|
|
|
|
var async = require('async');
|
|
|
|
|
var _ = require('underscore');
|
|
|
|
|
|
|
|
|
|
var db = require('./database');
|
|
|
|
|
var posts = require('./posts');
|
|
|
|
|
var utils = require('../public/src/utils');
|
|
|
|
|
var plugins = require('./plugins');
|
|
|
|
|
var user = require('./user');
|
|
|
|
|
var categories = require('./categories');
|
|
|
|
|
var privileges = require('./privileges');
|
|
|
|
|
var social = require('./social');
|
|
|
|
|
|
|
|
|
|
(function(Topics) {
|
|
|
|
|
|
|
|
|
@ -179,7 +180,8 @@ var async = require('async'),
|
|
|
|
|
threadTools: async.apply(plugins.fireHook, 'filter:topic.thread_tools', {topic: topicData, uid: uid, tools: []}),
|
|
|
|
|
tags: async.apply(Topics.getTopicTagsObjects, topicData.tid),
|
|
|
|
|
isFollowing: async.apply(Topics.isFollowing, [topicData.tid], uid),
|
|
|
|
|
bookmark: async.apply(Topics.getUserBookmark, topicData.tid, uid)
|
|
|
|
|
bookmark: async.apply(Topics.getUserBookmark, topicData.tid, uid),
|
|
|
|
|
postSharing: async.apply(social.getActivePostSharing)
|
|
|
|
|
}, next);
|
|
|
|
|
},
|
|
|
|
|
function (results, next) {
|
|
|
|
@ -189,6 +191,7 @@ var async = require('async'),
|
|
|
|
|
topicData.tags = results.tags;
|
|
|
|
|
topicData.isFollowing = results.isFollowing[0];
|
|
|
|
|
topicData.bookmark = results.bookmark;
|
|
|
|
|
topicData.postSharing = results.postSharing;
|
|
|
|
|
|
|
|
|
|
topicData.unreplied = parseInt(topicData.postcount, 10) === 1;
|
|
|
|
|
topicData.deleted = parseInt(topicData.deleted, 10) === 1;
|
|
|
|
|