mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	fixed #744
This commit is contained in:
		
							
								
								
									
										40
									
								
								src/posts.js
									
									
									
									
									
								
							
							
						
						
									
										40
									
								
								src/posts.js
									
									
									
									
									
								
							| @@ -426,24 +426,30 @@ var db = require('./database'), | ||||
| 				return callback(err); | ||||
| 			} | ||||
|  | ||||
| 			if (pids && pids.length) { | ||||
| 				plugins.fireHook('filter:post.getTopic', pids, function(err, posts) { | ||||
| 					if(err) { | ||||
| 						return callback(err); | ||||
| 					} | ||||
|  | ||||
| 					if (posts && posts.length) { | ||||
| 						Posts.getPostsByPids(pids, function(err, posts) { | ||||
| 							plugins.fireHook('action:post.gotTopic', posts); | ||||
| 							callback(null, posts); | ||||
| 						}); | ||||
| 					} else { | ||||
| 						callback(null, []); | ||||
| 					} | ||||
| 			async.filter(pids, function(pid, next) { | ||||
| 				postTools.privileges(pid, 0, function(privileges) { | ||||
| 					next(privileges.read); | ||||
| 				}); | ||||
| 			} else { | ||||
| 				callback(null, []); | ||||
| 			} | ||||
| 			}, function(pids) { | ||||
| 				if (pids && pids.length) { | ||||
| 					plugins.fireHook('filter:post.getTopic', pids, function(err, posts) { | ||||
| 						if(err) { | ||||
| 							return callback(err); | ||||
| 						} | ||||
|  | ||||
| 						if (posts && posts.length) { | ||||
| 							Posts.getPostsByPids(pids, function(err, posts) { | ||||
| 								plugins.fireHook('action:post.gotTopic', posts); | ||||
| 								callback(null, posts); | ||||
| 							}); | ||||
| 						} else { | ||||
| 							callback(null, []); | ||||
| 						} | ||||
| 					}); | ||||
| 				} else { | ||||
| 					callback(null, []); | ||||
| 				} | ||||
| 			}); | ||||
| 		}); | ||||
| 	} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user