mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
fix flagging and post filter
cant flag posts that don't exist anymore
This commit is contained in:
@@ -303,6 +303,9 @@ SocketPosts.flag = function(socket, pid, callback) {
|
||||
post;
|
||||
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
posts.flag(pid, next);
|
||||
},
|
||||
function(next) {
|
||||
user.getUserFields(socket.uid, ['username', 'reputation'], next);
|
||||
},
|
||||
@@ -323,7 +326,7 @@ SocketPosts.flag = function(socket, pid, callback) {
|
||||
},
|
||||
function(topicTitle, next) {
|
||||
message = '[[notifications:user_flagged_post_in, ' + userName + ', ' + topicTitle + ']]';
|
||||
postTools.parse(post, socket.uid, next);
|
||||
postTools.parsePost(post, socket.uid, next);
|
||||
},
|
||||
function(post, next) {
|
||||
groups.get('administrators', {}, next);
|
||||
@@ -342,9 +345,6 @@ SocketPosts.flag = function(socket, pid, callback) {
|
||||
notifications.push(notification, adminGroup.members, next);
|
||||
});
|
||||
},
|
||||
function(next) {
|
||||
posts.flag(pid, next);
|
||||
},
|
||||
function(next) {
|
||||
if (!parseInt(post.uid, 10)) {
|
||||
return next();
|
||||
|
||||
Reference in New Issue
Block a user