|
|
|
@ -24,7 +24,23 @@ marked.setOptions({
|
|
|
|
|
|
|
|
|
|
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++) {
|
|
|
|
|
content.push('pid:' + pids[i] + ':content');
|
|
|
|
@ -34,7 +50,6 @@ marked.setOptions({
|
|
|
|
|
editor.push('pid:' + pids[i] + ':editor');
|
|
|
|
|
editTime.push('pid:' + pids[i] + ':edited');
|
|
|
|
|
deleted.push('pid:' + pids[i] + ':deleted');
|
|
|
|
|
pid.push(pids[i]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -90,8 +105,6 @@ marked.setOptions({
|
|
|
|
|
'postData' : results[1].posts
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Posts.get_tid_by_pid = function(pid, callback) {
|
|
|
|
@ -127,8 +140,8 @@ marked.setOptions({
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
user.getUserField(uid, 'lastposttime', function(lastposttime) {
|
|
|
|
|
|
|
|
|
|
user.getUserField(uid, 'lastposttime', function(lastposttime) {
|
|
|
|
|
if(new Date().getTime() - lastposttime < config.post_delay) {
|
|
|
|
|
socket.emit('event:alert', {
|
|
|
|
|
title: 'Too many posts!',
|
|
|
|
|