|
|
@ -24,7 +24,23 @@ marked.setOptions({
|
|
|
|
|
|
|
|
|
|
|
|
topics.markAsRead(tid, current_user);
|
|
|
|
topics.markAsRead(tid, current_user);
|
|
|
|
|
|
|
|
|
|
|
|
var content = [], uid = [], timestamp = [], pid = [], post_rep = [], editor = [], editTime = [], deleted = [];
|
|
|
|
Posts.getPostsByPids(pids, current_user, function(posts) {
|
|
|
|
|
|
|
|
callback(posts);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// todo, getPostsByPids has duplicated stuff, have that call this fn.
|
|
|
|
|
|
|
|
Posts.getPostSummaryByPids = function(pids, callback) {
|
|
|
|
|
|
|
|
var content = [], uid = [], timestamp = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Posts.getPostsByPids = function(pids, current_user, callback) {
|
|
|
|
|
|
|
|
var content = [], uid = [], timestamp = [], post_rep = [], editor = [], editTime = [], deleted = [];
|
|
|
|
|
|
|
|
|
|
|
|
for (var i=0, ii=pids.length; i<ii; i++) {
|
|
|
|
for (var i=0, ii=pids.length; i<ii; i++) {
|
|
|
|
content.push('pid:' + pids[i] + ':content');
|
|
|
|
content.push('pid:' + pids[i] + ':content');
|
|
|
@ -34,7 +50,6 @@ marked.setOptions({
|
|
|
|
editor.push('pid:' + pids[i] + ':editor');
|
|
|
|
editor.push('pid:' + pids[i] + ':editor');
|
|
|
|
editTime.push('pid:' + pids[i] + ':edited');
|
|
|
|
editTime.push('pid:' + pids[i] + ':edited');
|
|
|
|
deleted.push('pid:' + pids[i] + ':deleted');
|
|
|
|
deleted.push('pid:' + pids[i] + ':deleted');
|
|
|
|
pid.push(pids[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -90,8 +105,6 @@ marked.setOptions({
|
|
|
|
'postData' : results[1].posts
|
|
|
|
'postData' : results[1].posts
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Posts.get_tid_by_pid = function(pid, callback) {
|
|
|
|
Posts.get_tid_by_pid = function(pid, callback) {
|
|
|
@ -136,7 +149,10 @@ marked.setOptions({
|
|
|
|
RDB.del('cid:' + cid + ':read_by_uid');
|
|
|
|
RDB.del('cid:' + cid + ':read_by_uid');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
RDB.zadd('topics:recent_posts:tid:' + tid, (new Date()).getTime(), pid);
|
|
|
|
topics.get_cid_by_tid(tid, function(cid) {
|
|
|
|
|
|
|
|
RDB.zadd('categories:recent_posts:cid:' + cid, (new Date()).getTime(), pid);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Re-add the poster, so he/she does not get an "unread" flag on this topic
|
|
|
|
// Re-add the poster, so he/she does not get an "unread" flag on this topic
|
|
|
|
topics.markAsRead(tid, uid);
|
|
|
|
topics.markAsRead(tid, uid);
|
|
|
|