uses server-side bookmark if available

This commit is contained in:
bdharrington7
2015-07-21 23:46:05 +08:00
parent 45df5a3d0b
commit 4d99f60b3d
2 changed files with 8 additions and 4 deletions

View File

@@ -221,7 +221,8 @@ var async = require('async'),
category: async.apply(Topics.getCategoryData, tid),
threadTools: async.apply(plugins.fireHook, 'filter:topic.thread_tools', {topic: topicData, uid: uid, tools: []}),
tags: async.apply(Topics.getTopicTagsObjects, tid),
isFollowing: async.apply(Topics.isFollowing, [tid], uid)
isFollowing: async.apply(Topics.isFollowing, [tid], uid),
bookmark: async.apply(Topics.getUserBookmark, tid, uid)
}, function(err, results) {
if (err) {
return callback(err);
@@ -232,6 +233,7 @@ var async = require('async'),
topicData.thread_tools = results.threadTools.tools;
topicData.tags = results.tags;
topicData.isFollowing = results.isFollowing[0];
topicData.bookmark = results.bookmark;
topicData.unreplied = parseInt(topicData.postcount, 10) === 1;
topicData.deleted = parseInt(topicData.deleted, 10) === 1;